/** * Sets a column of the matrix to the given column. Performs a deep copy. * * @param index the column's index * @param newColumn an array of doubles */ public final void setColumn(int index, double[] newColumn) { for (int i = 0; i < numRows(); i++) { m_Matrix.set(i, index, newColumn[i]); } }
/** * Sets a column of the matrix to the given column. Performs a deep copy. * * @param index the column's index * @param newColumn an array of doubles */ public final void setColumn(int index, double[] newColumn) { for (int i = 0; i < numRows(); i++) { m_Matrix.set(i, index, newColumn[i]); } }
/** * Gets a column of the matrix and returns it as a double array. * * @param index the column's index * @return an array of doubles */ public double[] getColumn(int index) { double[] newColumn = new double[this.numRows()]; for (int i = 0; i < newColumn.length; i++) { newColumn[i] = getElement(i, index); } return newColumn; }
/** * Gets a column of the matrix and returns it as a double array. * * @param index the column's index * @return an array of doubles */ public double[] getColumn(int index) { double[] newColumn = new double[this.numRows()]; for (int i = 0; i < newColumn.length; i++) { newColumn[i] = getElement(i, index); } return newColumn; }
node = addElement(parent, name, o.getClass().getName(), false); array = new double[matrix.numRows()][]; for (i = 0; i < array.length; i++) { array[i] = matrix.getRow(i);
/** * Returns the U part of the matrix. This does only make sense after LU * decomposition. * * @return matrix with the U part of a matrix; * @see #LUDecomposition() */ public Matrix getU() throws Exception { int nr = numRows(); // num of rows int nc = numColumns(); // num of columns double[][] ud = new double[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = i; j < nc; j++) { ud[i][j] = getElement(i, j); } } Matrix u = new Matrix(ud); return u; }
node = addElement(parent, name, o.getClass().getName(), false); array = new double[matrix.numRows()][]; for (i = 0; i < array.length; i++) { array[i] = matrix.getRow(i);
/** * Returns the U part of the matrix. This does only make sense after LU * decomposition. * * @return matrix with the U part of a matrix; * @see #LUDecomposition() */ public Matrix getU() throws Exception { int nr = numRows(); // num of rows int nc = numColumns(); // num of columns double[][] ud = new double[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = i; j < nc; j++) { ud[i][j] = getElement(i, j); } } Matrix u = new Matrix(ud); return u; }
/** * Returns the L part of the matrix. This does only make sense after LU * decomposition. * * @return matrix with the L part of the matrix; * @see #LUDecomposition() */ public Matrix getL() throws Exception { int nr = numRows(); // num of rows int nc = numColumns(); // num of columns double[][] ld = new double[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; (j < i) && (j < nc); j++) { ld[i][j] = getElement(i, j); } if (i < nc) { ld[i][i] = 1; } } Matrix l = new Matrix(ld); return l; }
/** * Returns the L part of the matrix. This does only make sense after LU * decomposition. * * @return matrix with the L part of the matrix; * @see #LUDecomposition() */ public Matrix getL() throws Exception { int nr = numRows(); // num of rows int nc = numColumns(); // num of columns double[][] ld = new double[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; (j < i) && (j < nc); j++) { ld[i][j] = getElement(i, j); } if (i < nc) { ld[i][i] = 1; } } Matrix l = new Matrix(ld); return l; }
int nr = numRows(); int nc = numColumns(); for (int i = 0; i < nr; i++) {
int nr = numRows(); int nc = numColumns(); for (int i = 0; i < nr; i++) {
int nr = numRows(); int nc = numColumns(); for (int i = 0; i < nr; i++) {
int nr = numRows(); int nc = numColumns(); for (int i = 0; i < nr; i++) {