#if DEBUG foreach (var bundle in BundleTable.Bundles) { bundle.Transform = new NoTransform(); } #endif
/** * {@inheritDoc} */ public void transform(File inputMatrixFile, MatrixIO.Format format, File outputMatrixFile) throws IOException { transform = getTransform(inputMatrixFile, format); FileTransformer transformer = MatrixIO.fileTransformer(format); transformer.transform(inputMatrixFile, outputMatrixFile, transform); }
private static Matrix multiplyLeftDiag(Matrix m1, Matrix m2) { Matrix resultMatrix = create(m1.rows(), m2.columns(), true); for (int r = 0; r < m1.rows(); ++r) { double element = m1.get(r, r); double[] m2Row = m2.getRow(r); for (int c = 0; c < m2.columns(); ++c) resultMatrix.set(r, c, element * m2Row[c]); } return resultMatrix; }
/** * {@inheritDoc} */ public DoubleVector getRowVector(int row) { return backingMatrix.getRowVector(getRealRow(row)); }
/** * {@inheritDoc} */ public MatrixFile getMatrixFile() { return new MatrixFile(getFile(), getMatrixFormat()); }
/** * {@inheritDoc} */ public void setColumn(int column, double[] values) { column = getIndexFromMap(colMaskMap, column); for (int r = 0; r < rows(); ++r) matrix.set(getIndexFromMap(rowMaskMap, r), column, values[r]); }
/** * {@inheritDoc} */ public void setRow(int row, double[] columns) { row = getIndexFromMap(rowMaskMap, row); for (int c = 0; c < columns(); ++c) matrix.set(row, getIndexFromMap(colMaskMap, c), columns[c]); }
/** * {@inheritDoc} */ public MatrixFile getMatrixFile() { return new MatrixFile(getFile(), getMatrixFormat()); }
/** * {@inheritDoc} */ public void setRow(int row, DoubleVector values) { backingMatrix.setRow(getRealRow(row), values); }
/** * {@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 double[] rank(SparseMatrix adj) { return rank(adj, initialRanks(adj.rows())); }
/** * {@inheritDoc} */ public void set(int row, int col, double val) { backingMatrix.set(getRealRow(row), col, val); }
/** * {@inheritDoc} */ public double[] getColumn(int column) { return backingMatrix.getColumn(getRealColumn(column)); }
/** * {@inheritDoc} */ protected GlobalTransform getTransform(Matrix matrix) { return new FilteredGlobalTransform(base.getTransform(matrix)); }
/** * {@inheritDoc} */ public DoubleVector getColumnVector(int column) { return backingMatrix.getColumnVector(getRealColumn(column)); }
/** * {@inheritDoc} */ public void transform(File inputMatrixFile, MatrixIO.Format format, File outputMatrixFile) throws IOException { GlobalTransform transform = getTransform(inputMatrixFile, format); FileTransformer transformer = MatrixIO.fileTransformer(format); transformer.transform(inputMatrixFile, outputMatrixFile, transform); }
/** * {@inheritDoc} */ public DoubleVector getRowVector(int row) { return backingMatrix.getRowVector(getRealRow(row)); }
/** * {@inheritDoc} */ public MatrixFile getMatrixFile() { return new MatrixFile(getFile(), getMatrixFormat()); }