Tabnine Logo
com.ociweb.pronghorn.stage.math
Code IndexAdd Tabnine to your IDE (free)

How to use com.ociweb.pronghorn.stage.math

Best Java code snippets using com.ociweb.pronghorn.stage.math (Showing top 20 results out of 315)

origin: oci-pronghorn/Pronghorn

public static MatrixSchema buildResultSchema(MatrixSchema leftSchema, MatrixSchema rightSchema) {
  assert(leftSchema.type == rightSchema.type);
  return buildSchema(leftSchema.getRows(), rightSchema.getColumns(), leftSchema.type);
}
origin: oci-pronghorn/Pronghorn

protected MatrixSchema(int rows, int columns, MatrixTypes type, FieldReferenceOffsetManager from) {
  super(from);
                
  this.rows = rows;
  this.columns = columns;
  
  this.type = type;
  this.typeSize = type.size();
}

origin: oci-pronghorn/Pronghorn

public static HistogramSumStage newInstance(GraphManager gm, 
                      Pipe<HistogramSchema> output, 
                      Pipe<HistogramSchema> ... inputs) {
  return new HistogramSumStage(gm, output, inputs);
}

origin: oci-pronghorn/Pronghorn

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;
}
origin: oci-pronghorn/Pronghorn

  int len) {
MatrixSchema<M> leftSchema = leftInput.config().schema().rootSchema(); 
             new Pipe<RowSchema<M>>(leftInput.config().grow2x());
new ColumnComputeStage( gm, 
            inputs, 
            splitterPipes[--splitterPipesCount] = pipe,
            outputs, 
            resultSchema, leftSchema, rightSchema.getRows(), rightSchema.getColumns(), rightSchema.type);
return splitterPipesCount;
origin: oci-pronghorn/Pronghorn

/**
 *
 * @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);
  
}
origin: oci-pronghorn/Pronghorn

super(graphManager, join(colInput, rowInput), colOutput);
this.colInput = colInput;
this.rowInput = rowInput;
this.rowLimit = resultSchema.getRows();		
this.remainingRows = rowLimit; 
if (cSchema.getColumns() != rRows) {
  throw new UnsupportedOperationException("column count of left input must match row count of right input "+cSchema.getColumns()+" vs "+rRows);
if (resultSchema.getColumns() != rCols) {
  throw new UnsupportedOperationException("column count of right input must match result output "+ rCols+" vs "+resultSchema.getColumns());
if (resultSchema.getRows() != cSchema.getRows()) {
  throw new UnsupportedOperationException("rows count of left input must match result output "+cSchema.getColumns()+" vs "+resultSchema.getRows());
origin: oci-pronghorn/Pronghorn

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;
}
origin: oci-pronghorn/Pronghorn

/**
 *
 * @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;
}
origin: oci-pronghorn/Pronghorn

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);
  }
}
origin: oci-pronghorn/Pronghorn

public DecimalSchema(MatrixSchema<M> matrixSchema) {
  super(matrixSchema.getColumns(), 1, MatrixTypes.Decimals, FieldReferenceOffsetManager.buildSingleNumberBlockFrom(matrixSchema.columns, MatrixTypes.Decimals.typeMask, "Matrix"));
}
origin: oci-pronghorn/Pronghorn

protected ColumnSchema(MatrixSchema<M> matrixSchema) {
  super(matrixSchema.getRows(), 1, matrixSchema.type, FieldReferenceOffsetManager.buildSingleNumberBlockFrom(matrixSchema.rows, matrixSchema.type.typeMask, "Matrix"));	
  this.root = matrixSchema;
}
  
origin: oci-pronghorn/Pronghorn

@Override
public void run() {
  
  while (Pipe.hasContentToRead(input) && Pipe.hasRoomForWrite(output)) {
  
    int msgIn = Pipe.takeMsgIdx(input);
    if (msgIn<0) {
      Pipe.publishEOF(output);
      requestShutdown();
      return;
    }
    
    int msgSize = Pipe.addMsgIdx(output, msgIn);//WARNING: using the same id as we just took in,
    
    inputType.convertToDecimal(blockSize, input, output);
    
    Pipe.confirmLowLevelWrite(output, msgSize);
    Pipe.publishWrites(output);
    
    Pipe.confirmLowLevelRead(input, Pipe.sizeOf(input, msgIn));
    Pipe.releaseReadLock(input);
    
  }
  
}
origin: oci-pronghorn/Pronghorn

goCompute(type.ordinal(), Pipe.slab(rowInput), rowSourceLoc, Pipe.slabMask(rowInput), rRows, 
     inputPipes, cPos, slabMask, outputPipes, cPosOut, outMask);
origin: oci-pronghorn/Pronghorn

public static <M extends MatrixSchema<M>> MatrixSchema<M> buildSchema(int rows, int columns, MatrixTypes type) {
  return new MatrixSchema<M>(rows, columns, type);
}
origin: oci-pronghorn/Pronghorn

public static HistogramSelectPeakStage newInstance(GraphManager gm, Pipe<HistogramSchema> input, Pipe<ProbabilitySchema> output) {
  return new HistogramSelectPeakStage(gm,input,output);
}

origin: oci-pronghorn/Pronghorn

public static void consume(Pipe<ProbabilitySchema> input) {
  while (PipeReader.tryReadFragment(input)) {
    int msgIdx = PipeReader.getMsgIdx(input);
    switch(msgIdx) {
      case MSG_SELECTION_1:
        consumeSelection(input);
      break;
      case -1:
        //requestShutdown();
      break;
    }
    PipeReader.releaseReadLock(input);
  }
}
origin: oci-pronghorn/Pronghorn

public static void consume(Pipe<HistogramSchema> input) {
  while (PipeReader.tryReadFragment(input)) {
    int msgIdx = PipeReader.getMsgIdx(input);
    switch(msgIdx) {
      case MSG_HISTOGRAM_1:
        consumeHistogram(input);
      break;
      case -1:
        //requestShutdown();
      break;
    }
    PipeReader.releaseReadLock(input);
  }
}
origin: oci-pronghorn/Pronghorn

private void vectorOperations() {
  long rowSourceLoc = Pipe.getWorkingTailPosition(rowInput);	
  int i = colInput.length;
  while (--i>=0) {
    long sourceLoc = Pipe.getWorkingTailPosition(colInput[i]);	
    Pipe.setWorkingTailPosition(rowInput, rowSourceLoc);                
    //add one value to the output pipe
    //value taken from full rowInput and full inputPipe input				
    type.computeColumn(rRows, colInput[i], rowInput, colOutput[i]);
    if (remainingRows>0) {  
      //restore for next pass but not for the very last one.
      Pipe.setWorkingTailPosition(colInput[i],sourceLoc);
    }
    
  }
}
origin: oci-pronghorn/Pronghorn

public RowSchema(MatrixSchema<M> matrixSchema) {
  super(matrixSchema.getColumns(), 1, matrixSchema.type, FieldReferenceOffsetManager.buildSingleNumberBlockFrom(matrixSchema.columns, matrixSchema.type.typeMask, "Matrix"));
  this.root = matrixSchema;
}

com.ociweb.pronghorn.stage.math

Most used classes

  • BuildMatrixCompute$MatrixTypes
    TOOD: recursive call for loop (why needed) stop with node TTL depth TODO: send multiple column pipes
  • BuildMatrixCompute
  • ColumnSchema
    Represents a column inside a matrix.
  • ColumnsToRowsStage
    _no-docs_ Stage that converts columns to rows in a matrix.
  • ConvertToDecimalStage
    _no-docs_ Converts data in matrix to decimal data onto the matrix.
  • HistogramSelectPeakStage,
  • HistogramSumStage,
  • MatrixSchema,
  • ProbabilitySchema,
  • RowSchema,
  • RowsToColumnRouteStage,
  • ColumnComputeStage,
  • DecimalSchema
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now