/** * {@inheritDoc} */ public DoubleVector getColumnVector(int column) { return m.getRowVector(column); }
/** * Compute the row sums of the values in {@code matrix} and returns the * values in a vector of length {@code matrix.columns()}. */ protected static <T extends Matrix> DoubleVector computeMatrixRowSum( T matrix) { DoubleVector rowSums = new DenseVector(matrix.columns()); for (int r = 0; r < matrix.rows(); ++r) VectorMath.add(rowSums, matrix.getRowVector(r)); return rowSums; }
/** * Creates an instance of {@code RowMagnitudeGlobalTransform} from a * {@link Matrix}. */ public RowMagnitudeGlobalTransform(Matrix matrix) { rowMagnitudes = new double[matrix.rows()]; for (int r = 0; r < matrix.rows(); ++r) rowMagnitudes[r] = matrix.getRowVector(r).magnitude(); }
/** * {@inheritDoc} */ public synchronized void setRow(int row, double[] values) { m.setRow(row, values); }
/** * {@inheritDoc} */ public double[] getColumn(int column) { return m.getRow(column); }
/** * {@inheritDoc} */ public synchronized void setColumn(int column, double[] values) { m.setColumn(column, values); }
/** * {@inheritDoc} */ public int rows() { return backingMatrix.rows(); }
/** * {@inheritDoc} */ public DoubleVector getRowVector(int row) { return m.getColumnVector(row); }
"The document space has not yet been generated."); if (documentNumber < 0 || documentNumber >= wordSpace.columns()) { throw new IllegalArgumentException( "Document number is not within the bounds of the number of " + "documents: " + documentNumber); return wordSpace.getColumnVector(documentNumber);
/** * {@inheritDoc} */ public double[] getRow(int row) { return m.getColumn(row); }
/** * {@inheritDoc} */ public void set(int row, int col, double val) { row = getIndexFromMap(rowMaskMap, row); col = getIndexFromMap(colMaskMap, col); matrix.set(row, col, val); }
/** * {@inheritDoc} */ public int getVectorLength() { return syntacticCooccurrence.columns(); } }
/** * {@inheritDoc} */ public double get(int row, int col) { return backingMatrix.get(getRealRow(row), col); }
/** * Compute the row sums of the values in {@code matrix} and returns the * values in a vector of length {@code matrix.columns()}. */ protected static <T extends Matrix> DoubleVector computeMatrixRowSum( T matrix) { DoubleVector rowSums = new DenseVector(matrix.columns()); for (int r = 0; r < matrix.rows(); ++r) VectorMath.add(rowSums, matrix.getRowVector(r)); return rowSums; }