protected void writeBatch(Collection<RowAccumulator> batch) throws IOException { for (RowAccumulator ra: batch) { writer.writeRow(ra.toRow(matrix.getValueConf())); } }
public LSHForestKNNFinder(DenseMatrix matrix) throws IOException { this.matrix = matrix; this.ids = matrix.getRowIds(); this.dimensions = matrix.getRow(ids[0]).getNumCols(); }
@Override public SparseMatrixRow getRow(int rowId) throws IOException { ByteBuffer bb = rowBuffers.getRow(rowId); if (bb == null) { return null; } else { return new SparseMatrixRow(vconf, bb); } }
public SparseMatrixTransposer(SparseMatrix m, File f, int bufferMb) throws IOException { this.matrix = m; this.writer = new SparseMatrixWriter(f, m.getValueConf()); this.bufferMb = bufferMb; this.numColsTransposed = 0; }
@Override public DenseMatrixRow getRow(int rowId) throws IOException { ByteBuffer bb = rowBuffers.getRow(rowId); if (bb == null) { return null; } else { return new DenseMatrixRow(vconf, colIds, bb); } }
public SparseMatrixRow(ValueConf vconf, int rowIndex, int colIds[], float colVals[]) { this.vconf = vconf; short packed[] = new short[colVals.length]; for (int i = 0; i < colVals.length; i++) { packed[i] = vconf.pack(colVals[i]); } createBuffer(rowIndex, colIds, packed); }
public LSHForestKNNFinder(DenseMatrix matrix) throws IOException { this.matrix = matrix; this.ids = matrix.getRowIds(); this.dimensions = matrix.getRow(ids[0]).getNumCols(); }
protected void writeBatch(Collection<RowAccumulator> batch) throws IOException { for (RowAccumulator ra: batch) { writer.writeRow(ra.toRow(matrix.getValueConf())); } }
@Override public SparseMatrixRow getRow(int rowId) throws IOException { ByteBuffer bb = rowBuffers.getRow(rowId); if (bb == null) { return null; } else { return new SparseMatrixRow(vconf, bb); } }
public SparseMatrixTransposer(SparseMatrix m, File f, int bufferMb) throws IOException { this.matrix = m; this.writer = new SparseMatrixWriter(f, m.getValueConf()); this.bufferMb = bufferMb; this.numColsTransposed = 0; }
@Override public DenseMatrixRow getRow(int rowId) throws IOException { ByteBuffer bb = rowBuffers.getRow(rowId); if (bb == null) { return null; } else { return new DenseMatrixRow(vconf, colIds, bb); } }
public SparseMatrixRow(ValueConf vconf, int rowIndex, int colIds[], float colVals[]) { this.vconf = vconf; short packed[] = new short[colVals.length]; for (int i = 0; i < colVals.length; i++) { packed[i] = vconf.pack(colVals[i]); } createBuffer(rowIndex, colIds, packed); }
public KDTreeKNN(DenseMatrix matrix) throws IOException { this.matrix = matrix; this.allIds = matrix.getRowIds(); this.dimensions = matrix.getRow(allIds[0]).getNumCols(); }
public RandomProjectionKNNFinder(DenseMatrix matrix) throws IOException { this.matrix = matrix; this.ids = matrix.getRowIds(); this.dimensions = matrix.getRow(ids[0]).getNumCols(); }
public RandomProjectionKNNFinder(DenseMatrix matrix) throws IOException { this.matrix = matrix; this.ids = matrix.getRowIds(); this.dimensions = matrix.getRow(ids[0]).getNumCols(); }
public KDTreeKNN(DenseMatrix matrix) throws IOException { this.matrix = matrix; this.allIds = matrix.getRowIds(); this.dimensions = matrix.getRow(allIds[0]).getNumCols(); }