public DoubleMatrix2D like(int rows, int columns) { return new DenseColumnDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like(int rows, int columns) { return new DenseColumnDoubleMatrix2D(rows, columns); }
/** * Construct and returns a new empty matrix <i>of the same dynamic type</i> * as the receiver, having the specified number of rows and columns. For * example, if the receiver is an instance of type * <tt>DenseColDoubleMatrix2D</tt> the new matrix must also be of type * <tt>DenseColDoubleMatrix2D</tt>, if the receiver is an instance of type * <tt>SparseColDoubleMatrix2D</tt> the new matrix must also be of type * <tt>SparseColDoubleMatrix2D</tt>, etc. In general, the new matrix should * have internal parametrization as similar as possible. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @return a new empty matrix of the same dynamic type. */ public DoubleMatrix2D like(int rows, int columns) { return new DenseColumnDoubleMatrix2D(rows, columns); }
/** * Construct and returns a new empty matrix <i>of the same dynamic type</i> * as the receiver, having the specified number of rows and columns. For * example, if the receiver is an instance of type * <tt>DenseColDoubleMatrix2D</tt> the new matrix must also be of type * <tt>DenseColDoubleMatrix2D</tt>, if the receiver is an instance of type * <tt>SparseColDoubleMatrix2D</tt> the new matrix must also be of type * <tt>SparseColDoubleMatrix2D</tt>, etc. In general, the new matrix should * have internal parametrization as similar as possible. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @return a new empty matrix of the same dynamic type. */ public DoubleMatrix2D like(int rows, int columns) { return new DenseColumnDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D getLtranspose() { if (Lt != null) { return Lt; } else { if (columnMatrix) { Lt = new DenseColumnDoubleMatrix2D(n, n); double[] Lelems = (double[]) Lt.elements(); for (int c = n; --c >= 0;) { for (int r = n; --r >= c;) { Lelems[r * n + c] = elementsA[r * n + c]; } } } else { Lt = new DenseDoubleMatrix2D(n, n); double[] Lelems = (double[]) Lt.elements(); for (int c = n; --c >= 0;) { for (int r = n; --r >= c;) { Lelems[c * n + r] = elementsA[r * n + c]; } } } return Lt; } }
public DoubleMatrix2D getLtranspose() { if (Lt != null) { return Lt; } else { if (columnMatrix) { Lt = new DenseColumnDoubleMatrix2D(n, n); double[] Lelems = (double[]) Lt.elements(); for (int c = n; --c >= 0;) { for (int r = n; --r >= c;) { Lelems[r * n + c] = elementsA[r * n + c]; } } } else { Lt = new DenseDoubleMatrix2D(n, n); double[] Lelems = (double[]) Lt.elements(); for (int c = n; --c >= 0;) { for (int r = n; --r >= c;) { Lelems[c * n + r] = elementsA[r * n + c]; } } } return Lt; } }
/** * Returns the right singular vectors <tt>V</tt>. * * @return <tt>V</tt> */ public DoubleMatrix2D getV() { if (wantUV == false) { throw new IllegalAccessError("Matrix V was not computed"); } else { if (V == null) { if (wantWholeUV == false) { if (columnMatrix) { V = new DenseColumnDoubleMatrix2D(mn, n).assign(elementsVt).viewDice(); } else { V = new DenseDoubleMatrix2D(n, mn).assign(elementsVt); } } else { if (columnMatrix) { V = new DenseColumnDoubleMatrix2D(n, n).assign(elementsVt).viewDice(); } else { V = new DenseDoubleMatrix2D(n, n).assign(elementsVt); } } } return V.copy(); } }
/** * Returns the left singular vectors <tt>U</tt>. * * @return <tt>U</tt> */ public DoubleMatrix2D getU() { if (wantUV == false) { throw new IllegalAccessError("Matrix U was not computed"); } else { if (U == null) { if (wantWholeUV == false) { if (columnMatrix) { U = new DenseColumnDoubleMatrix2D(m, mn).assign(elementsU); } else { U = new DenseDoubleMatrix2D(mn, m).assign(elementsU).viewDice(); } } else { if (columnMatrix) { U = new DenseColumnDoubleMatrix2D(m, m).assign(elementsU); } else { U = new DenseDoubleMatrix2D(m, m).assign(elementsU).viewDice(); } } } return U.copy(); } }
/** * Returns the right singular vectors <tt>V</tt>. * * @return <tt>V</tt> */ public DoubleMatrix2D getV() { if (wantUV == false) { throw new IllegalAccessError("Matrix V was not computed"); } else { if (V == null) { if (wantWholeUV == false) { if (columnMatrix) { V = new DenseColumnDoubleMatrix2D(mn, n).assign(elementsVt).viewDice(); } else { V = new DenseDoubleMatrix2D(n, mn).assign(elementsVt); } } else { if (columnMatrix) { V = new DenseColumnDoubleMatrix2D(n, n).assign(elementsVt).viewDice(); } else { V = new DenseDoubleMatrix2D(n, n).assign(elementsVt); } } } return V.copy(); } }
/** * Returns the left singular vectors <tt>U</tt>. * * @return <tt>U</tt> */ public DoubleMatrix2D getU() { if (wantUV == false) { throw new IllegalAccessError("Matrix U was not computed"); } else { if (U == null) { if (wantWholeUV == false) { if (columnMatrix) { U = new DenseColumnDoubleMatrix2D(m, mn).assign(elementsU); } else { U = new DenseDoubleMatrix2D(mn, m).assign(elementsU).viewDice(); } } else { if (columnMatrix) { U = new DenseColumnDoubleMatrix2D(m, m).assign(elementsU); } else { U = new DenseDoubleMatrix2D(m, m).assign(elementsU).viewDice(); } } } return U.copy(); } }
C = new DenseColumnDoubleMatrix2D(rowsC, columnsC); } else { if (rowsA != C.rows() || columnsB != C.columns()) {
C = new DenseColumnDoubleMatrix2D(rowsC, columnsC); } else { if (rowsA != C.rows() || columnsB != C.columns()) {
/** * Returns the triangular factor, <tt>L</tt>. * * @return <tt>L</tt> */ public DoubleMatrix2D getL() { if (Lt != null) { return Lt.viewDice().copy(); } else { if (columnMatrix) { Lt = new DenseColumnDoubleMatrix2D(n, n); double[] Lelems = (double[]) Lt.elements(); for (int c = n; --c >= 0;) { for (int r = n; --r >= c;) { Lelems[r * n + c] = elementsA[r * n + c]; } } } else { Lt = new DenseDoubleMatrix2D(n, n); double[] Lelems = (double[]) Lt.elements(); for (int c = n; --c >= 0;) { for (int r = n; --r >= c;) { Lelems[c * n + r] = elementsA[r * n + c]; } } } return Lt.viewDice().copy(); } }
/** * Returns the triangular factor, <tt>L</tt>. * * @return <tt>L</tt> */ public DoubleMatrix2D getL() { if (Lt != null) { return Lt.viewDice().copy(); } else { if (columnMatrix) { Lt = new DenseColumnDoubleMatrix2D(n, n); double[] Lelems = (double[]) Lt.elements(); for (int c = n; --c >= 0;) { for (int r = n; --r >= c;) { Lelems[r * n + c] = elementsA[r * n + c]; } } } else { Lt = new DenseDoubleMatrix2D(n, n); double[] Lelems = (double[]) Lt.elements(); for (int c = n; --c >= 0;) { for (int r = n; --r >= c;) { Lelems[c * n + r] = elementsA[r * n + c]; } } } return Lt.viewDice().copy(); } }
R = new DenseColumnDoubleMatrix2D(m, n); double[] elementsR = (double[]) R.elements(); for (int c = 0; c < n; c++) {
R = new DenseColumnDoubleMatrix2D(m, n); double[] elementsR = (double[]) R.elements(); for (int c = 0; c < n; c++) {
public DoubleMatrix2D getRealPart() { final DenseColumnDoubleMatrix2D R = new DenseColumnDoubleMatrix2D(rows, columns); final double[] elemsOther = R.elements(); final int columnStrideOther = R.columnStride();
public DoubleMatrix2D getImaginaryPart() { final DenseColumnDoubleMatrix2D Im = new DenseColumnDoubleMatrix2D(rows, columns); final double[] elemsOther = Im.elements(); final int columnStrideOther = Im.columnStride();
if (Q == null) { Dplasma.plasma_Init(m, n, 1); Q = new DenseColumnDoubleMatrix2D(m, m); double[] elementsQ = (double[]) Q.elements(); for (int i = 0; i < m; i++)
if (Q == null) { Dplasma.plasma_Init(m, n, 1); Q = new DenseColumnDoubleMatrix2D(m, m); double[] elementsQ = (double[]) Q.elements(); for (int i = 0; i < m; i++)