/** * {@inheritDoc} * * Note that any values are not on the diagonal are ignored. */ public void setColumn(int column, double[] values) { checkIndices(values.length - 1, column); values[column] = values[column]; }
/** * {@inheritDoc} * * Note that any values are not on the diagonal are ignored. */ public void setRow(int row, double[] values) { checkIndices(row, values.length - 1); values[row] = values[row]; }
/** * {@inheritDoc} */ public double[] getColumn(int column) { checkIndices(0, column); double[] columnValues = new double[values.length]; columnValues[column] = values[column]; return columnValues; }
/** * {@inheritDoc} * * Note that any values are not on the diagonal are ignored. */ public void setColumn(int column, double[] values) { checkIndices(values.length - 1, column); values[column] = values[column]; }
/** * {@inheritDoc} * * Note that any values are not on the diagonal are ignored. */ public void setRow(int row, double[] values) { checkIndices(row, values.length - 1); values[row] = values[row]; }
/** * {@inheritDoc} */ public double[] getRow(int row) { checkIndices(row, 0); double[] returnRow = new double[values.length]; returnRow[row] = values[row]; return returnRow; }
/** * {@inheritDoc} */ public double get(int row, int col) { checkIndices(row, col); if (row == col) return values[row]; return 0; }
/** * {@inheritDoc} */ public double get(int row, int col) { checkIndices(row, col); if (row == col) return values[row]; return 0; }
/** * {@inheritDoc} */ public double[] getColumn(int column) { checkIndices(0, column); double[] columnValues = new double[values.length]; columnValues[column] = values[column]; return columnValues; }
/** * {@inheritDoc} */ public double[] getRow(int row) { checkIndices(row, 0); double[] returnRow = new double[values.length]; returnRow[row] = values[row]; return returnRow; }
/** * {@inheritDoc} * * @throws IllegalArgumentException if {@code row != col} */ public void set(int row, int col, double val) { checkIndices(row, col); if (row != col) { throw new IllegalArgumentException( "cannot set non-diagonal elements in a DiagonalMatrix"); } values[row] = val; }
/** * {@inheritDoc} * * @throws IllegalArgumentException if {@code row != col} */ public void set(int row, int col, double val) { checkIndices(row, col); if (row != col) { throw new IllegalArgumentException( "cannot set non-diagonal elements in a DiagonalMatrix"); } values[row] = val; }
/** * {@inheritDoc} */ public SparseDoubleVector getRowVector(int row) { checkIndices(row, 0); SparseDoubleVector vector = new SparseHashDoubleVector(values.length); vector.set(row, values[row]); return vector; }
/** * {@inheritDoc} * * Note that any values are not on the diagonal are ignored. */ public void setColumn(int column, DoubleVector vector) { checkIndices(vector.length() - 1, column); values[column] = vector.get(column); }
/** * {@inheritDoc} */ public SparseDoubleVector getColumnVector(int column) { checkIndices(0, column); SparseDoubleVector columnValues = new SparseHashDoubleVector(values.length); columnValues.set(column, values[column]); return columnValues; }
/** * {@inheritDoc} */ public SparseDoubleVector getColumnVector(int column) { checkIndices(0, column); SparseDoubleVector columnValues = new SparseHashDoubleVector(values.length); columnValues.set(column, values[column]); return columnValues; }
/** * {@inheritDoc} * * Note that any values are not on the diagonal are ignored. */ public void setColumn(int column, DoubleVector vector) { checkIndices(vector.length() - 1, column); values[column] = vector.get(column); }
/** * {@inheritDoc} * * Note that any values are not on the diagonal are ignored. */ public void setRow(int row, DoubleVector vector) { checkIndices(row, vector.length() - 1); values[row] = vector.get(row); }
/** * {@inheritDoc} * * Note that any values are not on the diagonal are ignored. */ public void setRow(int row, DoubleVector vector) { checkIndices(row, vector.length() - 1); values[row] = vector.get(row); }
/** * {@inheritDoc} */ public SparseDoubleVector getRowVector(int row) { checkIndices(row, 0); SparseDoubleVector vector = new SparseHashDoubleVector(values.length); vector.set(row, values[row]); return vector; }