/** * {@inheritDoc} */ public void setColumn(int column, double[] values) { checkIndices(values.length - 1, column); for (int row = 0; row < rows; ++row) matrix[getIndex(row,column)] = values[column]; }
/** * {@inheritDoc} */ public void set(int row, int col, double val) { checkIndices(row, col); int index = getIndex(row, col); matrix[index] = val; }
/** * {@inheritDoc} */ public void set(int row, int col, double val) { checkIndices(row, col); int index = getIndex(row, col); matrix[index] = val; }
/** * {@inheritDoc} */ public double[] getColumn(int column) { checkIndices(0, column); double[] values = new double[rows]; for (int row = 0; row < rows; ++row) values[row] = get(row, column); return values; }
/** * {@inheritDoc} */ public void setColumn(int column, double[] values) { checkIndices(values.length - 1, column); for (int row = 0; row < rows; ++row) matrix[getIndex(row,column)] = values[column]; }
/** * {@inheritDoc} */ public double[] getColumn(int column) { checkIndices(0, column); double[] values = new double[rows]; for (int row = 0; row < rows; ++row) values[row] = get(row, column); return values; }
/** * {@inheritDoc} */ public void setRow(int row, double[] columns) { checkIndices(row, columns.length - 1); for (int col = 0; col < cols; ++col) matrix[getIndex(row,col)] = columns[col]; }
/** * {@inheritDoc} */ public double get(int row, int col) { checkIndices(row, col); int index = getIndex(row, col); return matrix[index]; }
/** * {@inheritDoc} */ public double[] getRow(int row) { checkIndices(row, 0); double[] rowArr = new double[cols]; int index = getIndex(row, 0); for (int i = 0; i < cols; ++i) rowArr[i] = matrix[index++]; return rowArr; }
/** * {@inheritDoc} */ public void setRow(int row, double[] columns) { checkIndices(row, columns.length - 1); for (int col = 0; col < cols; ++col) matrix[getIndex(row,col)] = columns[col]; }
/** * {@inheritDoc} */ public double get(int row, int col) { checkIndices(row, col); int index = getIndex(row, col); return matrix[index]; }
/** * {@inheritDoc} */ public double[] getRow(int row) { checkIndices(row, 0); double[] rowArr = new double[cols]; int index = getIndex(row, 0); for (int i = 0; i < cols; ++i) rowArr[i] = matrix[index++]; return rowArr; }
/** * {@inheritDoc} */ public DoubleVector getRowVector(int row) { checkIndices(row, 0); return new RowVector(getIndex(row, 0)); }
/** * {@inheritDoc} */ public DoubleVector getRowVector(int row) { checkIndices(row, 0); return new RowVector(getIndex(row, 0)); }
/** * {@inheritDoc} */ public void setColumn(int column, DoubleVector values) { checkIndices(values.length() - 1, column); for (int row = 0; row < rows; ++row) matrix[getIndex(row,column)] = values.get(row); }
/** * {@inheritDoc} */ public void setRow(int row, DoubleVector values) { checkIndices(row, values.length() - 1); for (int col = 0; col < cols; ++col) matrix[getIndex(row,col)] = values.get(col); }
/** * {@inheritDoc} */ public void setRow(int row, DoubleVector values) { checkIndices(row, values.length() - 1); for (int col = 0; col < cols; ++col) matrix[getIndex(row,col)] = values.get(col); }
/** * {@inheritDoc} */ public void setColumn(int column, DoubleVector values) { checkIndices(values.length() - 1, column); for (int row = 0; row < rows; ++row) matrix[getIndex(row,column)] = values.get(row); }