private static <M extends MatrixSchema<M>> MatrixSchema resultSchema(Pipe<RowSchema<M>> left, Pipe<RowSchema<M>> right) { MatrixSchema<M> leftSchema1 = left.config().schema().rootSchema(); MatrixSchema<M> rightSchema1 = right.config().schema().rootSchema(); MatrixSchema resultSchema = BuildMatrixCompute.buildResultSchema(leftSchema1, rightSchema1); return resultSchema; }
protected RowsToColumnRouteStage(GraphManager graphManager, Pipe<RowSchema<M>> rowPipeInput, Pipe<ColumnSchema<M>>[] columnPipeOutput) { super(graphManager, rowPipeInput, columnPipeOutput); M matrixSchema = (M) rowPipeInput.config().schema().rootSchema(); this.rowPipeInput = rowPipeInput; this.columnPipeOutput = columnPipeOutput; this.matrixSchema = matrixSchema; this.rowLimit = matrixSchema.getRows(); this.remainingRows = rowLimit; this.sizeOf = Pipe.sizeOf(columnPipeOutput[0], matrixSchema.columnId); if (matrixSchema.columns != columnPipeOutput.length) { throw new UnsupportedOperationException(matrixSchema.columns+" was expected to match "+columnPipeOutput.length); } }
/** * * @param graphManager * @param input _in_ Input pipe as matrix with RowSchema * @param output _out_ Output pipe in which RowSchema is converted to DecimalSchema */ public ConvertToDecimalStage(GraphManager graphManager, Pipe<RowSchema<M>> input, Pipe<DecimalSchema<M>> output) { super(graphManager, input, output); this.input = input; this.output = output; M schema = (M) input.config().schema(); this.blockSize = schema.getRows()*schema.getColumns(); this.inputType = schema.type; }
/** * * @param graphManager * @param columnPipeInput _in_ Pipes containing ColumnSchema that will be converted to RowSchema * @param matrixPipeOutput _out_ Pipes onto which ColumnSchema will be output to RowSchema */ public ColumnsToRowsStage(GraphManager graphManager, Pipe<ColumnSchema<M>>[] columnPipeInput, Pipe<RowSchema<M>> matrixPipeOutput) { super(graphManager, columnPipeInput, matrixPipeOutput); M matrixSchema = (M) matrixPipeOutput.config().schema().rootSchema(); this.columnPipeInput = columnPipeInput; this.matrixPipeOutput = matrixPipeOutput; this.matrixSchema = matrixSchema; this.shutdownCount = columnPipeInput.length; this.typeSize = matrixSchema.typeSize; this.rowLimit = matrixSchema.getRows(); this.columnLimit = matrixSchema.getColumns(); this.remainingRows = rowLimit; assert(columnLimit==columnPipeInput.length); this.colSizeOf = Pipe.sizeOf(columnPipeInput[0], matrixSchema.columnId); this.matrixSize = Pipe.sizeOf(matrixPipeOutput, matrixSchema.rowId); }
public static <M extends MatrixSchema<M>> Pipe<RowSchema<M>> buildProductGraphRR(GraphManager gm, int targetThreadCount, Pipe<RowSchema<M>> left, Pipe<RowSchema<M>> right) { Pipe<ColumnSchema<M>>[] colResults = buildProductGraphRC(gm, left, right, targetThreadCount); ////////////////// ////////////////// MatrixSchema resultSchema2 = colResults[0].config().schema().rootSchema(); PipeConfig<RowSchema<M>> config = new PipeConfig<RowSchema<M>>(new RowSchema<M>(resultSchema2), resultSchema2.getRows()); config.hideLabels(); Pipe<RowSchema<M>> rowResults = new Pipe<RowSchema<M>>(config); ColumnsToRowsStage<M> ctr = new ColumnsToRowsStage( gm, colResults, rowResults); return rowResults; }
int len) { MatrixSchema<M> leftSchema = leftInput.config().schema().rootSchema();
MatrixSchema<M> rightSchema = rightInput.config().schema().rootSchema();