@Override public void collect(Long rowIndex, Vector v) throws IOException { long blockKey = rowIndex / height; if (blockKey != currentBlockNum) { flushBlock(); if (block == null) { block = new SparseRowBlockWritable(100); } currentBlockNum = blockKey; } block.plusRow((int) (rowIndex % height), v); }
protected void accumDots(int aIndex, double aElement, double[] yRow) { for (int i = 0; i < kp; i++) { yRow[i] += getQuick(aIndex, i) * aElement; } }
/** * Get omega element at (x,y) uniformly distributed within [-1...1) * * @param row * omega row * @param column * omega column */ public double getQuick(int row, int column) { long hash = murmur64((long) row << Integer.SIZE | column, 8, seed); return hash / UNIFORM_DIVISOR; }
@Override protected void reduce(SplitPartitionedWritable key, Iterable<SparseRowBlockWritable> values, Context context) throws IOException, InterruptedException { accum.clear(); for (SparseRowBlockWritable bw : values) { accum.plusBlock(bw); } if (key.getTaskId() != lastTaskId) { setupBlock(context, key); } long blockBase = key.getTaskItemOrdinal() * blockHeight; for (int k = 0; k < accum.getNumRows(); k++) { Vector yiRow = accum.getRows()[k]; key.setTaskItemOrdinal(blockBase + accum.getRowIndices()[k]); qr.collect(key, yiRow); } }
// ... Capital.prototype = Object.create(Starship.prototype); Capital.prototype.constructor = Capital; // ... Omega.prototype = Object.create(Capital.prototype); Omega.prototype.constructor = Omega; // ... new Omega().constructor.name; // is now "Omega"
@Override public void close() throws IOException { flushBlock(); }
/** * Load multiple upper triangular matrices and sum them up. * * @return the sum of upper triangular inputs. */ public static DenseSymmetricMatrix loadAndSumUpperTriangularMatricesAsSymmetric(Path glob, Configuration conf) throws IOException { Vector v = loadAndSumUpVectors(glob, conf); return v == null ? null : new DenseSymmetricMatrix(v); }
static void generateDenseInput(Path outputPath, FileSystem dfs, Vector svalues, int m, int n) throws IOException { generateDenseInput(outputPath, dfs, svalues, m, n, 0); }
public void runPCATest0() throws IOException { runSSVDSolver(0); }
@Override protected void reduce(SplitPartitionedWritable key, Iterable<SparseRowBlockWritable> values, Context context) throws IOException, InterruptedException { accum.clear(); for (SparseRowBlockWritable bw : values) { accum.plusBlock(bw); } if (key.getTaskId() != lastTaskId) { setupBlock(context, key); } long blockBase = key.getTaskItemOrdinal() * blockHeight; for (int k = 0; k < accum.getNumRows(); k++) { Vector yiRow = accum.getRows()[k]; key.setTaskItemOrdinal(blockBase + accum.getRowIndices()[k]); qr.collect(key, yiRow); } }
@Override public void collect(Long rowIndex, Vector v) throws IOException { long blockKey = rowIndex / height; if (blockKey != currentBlockNum) { flushBlock(); if (block == null) { block = new SparseRowBlockWritable(100); } currentBlockNum = blockKey; } block.plusRow((int) (rowIndex % height), v); }
protected void accumDots(int aIndex, double aElement, double[] yRow) { for (int i = 0; i < kp; i++) { yRow[i] += getQuick(aIndex, i) * aElement; } }
/** * Get omega element at (x,y) uniformly distributed within [-1...1) * * @param row * omega row * @param column * omega column */ public double getQuick(int row, int column) { long hash = murmur64((long) row << Integer.SIZE | column, 8, seed); return hash / UNIFORM_DIVISOR; }
@Override public void close() throws IOException { flushBlock(); }
@Override public void collect(Long rowIndex, Vector v) throws IOException { long blockKey = rowIndex / height; if (blockKey != currentBlockNum) { flushBlock(); if (block == null) { block = new SparseRowBlockWritable(100); } currentBlockNum = blockKey; } block.plusRow((int) (rowIndex % height), v); }
protected void accumDots(int aIndex, double aElement, double[] yRow) { for (int i = 0; i < kp; i++) { yRow[i] += getQuick(aIndex, i) * aElement; } }
/** * Get omega element at (x,y) uniformly distributed within [-1...1) * * @param row * omega row * @param column * omega column */ public double getQuick(int row, int column) { long hash = murmur64((long) row << Integer.SIZE | column, 8, seed); return hash / UNIFORM_DIVISOR; }
@Override public void close() throws IOException { flushBlock(); }
protected void accumDots(int aIndex, double aElement, Vector yRow) { for (int i = 0; i < kp; i++) { yRow.setQuick(i, yRow.getQuick(i) + getQuick(aIndex, i) * aElement); } }