@Specialization(guards = {"x.isMatrix()", "y.isMatrix()"}) protected RDoubleVector crossprod( RAbstractDoubleVector x, RAbstractDoubleVector y, @Cached("create()") GetDimAttributeNode getXDimsNode, @Cached("create()") GetDimAttributeNode getYDimsNode, @Cached("create()") SetDimNamesAttributeNode setDimNamesNode, @Cached("create()") GetDimNamesAttributeNode getADimNamesNode, @Cached("create()") GetDimNamesAttributeNode getBDimNamesNode) { int[] xDims = getXDimsNode.getDimensions(x); int[] yDims = getYDimsNode.getDimensions(y); int xRows = xDims[0]; int xCols = xDims[1]; int yRows = yDims[0]; int yCols = yDims[1]; return matMult.doubleMatrixMultiply( x, y, xCols, xRows, yRows, yCols, xRows, 1, 1, yRows, false, setDimNamesNode, getADimNamesNode, getBDimNamesNode); }
@Specialization(guards = "x.isMatrix()") protected RDoubleVector crossprodDoubleMatrix( RAbstractDoubleVector x, @SuppressWarnings("unused") RNull y, @Cached("create()") GetDimAttributeNode getDimsNode, @Cached("create()") GetDimAttributeNode getResultDimsNode, @Cached("create()") SetDimNamesAttributeNode setDimNamesNode, @Cached("create()") GetDimNamesAttributeNode getADimNamesNode, @Cached("create()") GetDimNamesAttributeNode getBDimNamesNode) { int[] xDims = getDimsNode.getDimensions(x); int xRows = xDims[0]; int xCols = xDims[1]; return mirror( matMult.doubleMatrixMultiply( x, x, xCols, xRows, xRows, xCols, xRows, 1, 1, xRows, true, setDimNamesNode, getADimNamesNode, getBDimNamesNode), getResultDimsNode); }
private Object matMult(Object op1, Object op2) { return matMult.executeObject(op1, op2); }