public PCA_MTJ_SVD_DenseMatrix(double[][] gramMatrix) { this.gramMatrix = new DenseMatrix(gramMatrix); runSVD(); }
public PCA_MTJ_EVD_DenseMatrix(double[][] gramMatrix) { this.gramMatrix = new DenseMatrix(gramMatrix); runEVD(); }
public PCA_MTJ_EVD_SymmMatrix(double[][] gramMatrix) { this.symmGramMatrix = new UpperSymmDenseMatrix(new DenseMatrix(gramMatrix)); runEVD(); }
@Override public Vector solve(Vector b, Vector x) { DenseMatrix B = new DenseMatrix(b, false), X = new DenseMatrix(x, false); solve(B, X); return x; }
@Override public Vector solve(Vector b, Vector x) { DenseMatrix B = new DenseMatrix(b, false), X = new DenseMatrix(x, false); solve(B, X); return x; }
@Override public Vector solve(Vector b, Vector x) { DenseMatrix B = new DenseMatrix(b, false), X = new DenseMatrix(x, false); solve(B, X); return x; }
@Override public Vector transSolve(Vector b, Vector x) { DenseMatrix B = new DenseMatrix(b, false), X = new DenseMatrix(x, false); transSolve(B, X); return x; }
@Override public Vector transSolve(Vector b, Vector x) { DenseMatrix B = new DenseMatrix(b, false), X = new DenseMatrix(x, false); transSolve(B, X); return x; }
@Override public Vector solve(Vector b, Vector x) { DenseMatrix B = new DenseMatrix(b, false), X = new DenseMatrix(x, false); solve(B, X); return x; }
@Override public Vector solve(Vector b, Vector x) { DenseMatrix B = new DenseMatrix(b, false), X = new DenseMatrix(x, false); solve(B, X); return x; }
/** * Returns the column pivoting matrix. This function allocates a new Matrix * to be returned, a more cheap option is tu use {@link #getPVector()}. */ public Matrix getP() { Matrix P = new DenseMatrix(jpvt.length, jpvt.length); for (int i = 0; i < jpvt.length; i++) { P.set(jpvt[i], i, 1); } return P; }
/** * Returns the column pivoting matrix. This function allocates a new Matrix * to be returned, a more cheap option is tu use {@link #getPVector()}. */ public Matrix getP() { Matrix P = new DenseMatrix(jpvt.length, jpvt.length); for (int i = 0; i < jpvt.length; i++) { P.set(jpvt[i], i, 1); } return P; }
/** * Creates a random matrix. Numbers are drawn from a uniform distribution * between 0 and 1 * * @param numRows * Number of rows * @param numColumns * Number of columns */ public static Matrix random(int numRows, int numColumns) { return random(new DenseMatrix(numRows, numColumns)); }
/** * Creates an LU decomposition of the given matrix * * @param A * Matrix to decompose. Not modified * @return The current decomposition */ public static DenseLU factorize(Matrix A) { return new DenseLU(A.numRows(), A.numColumns()).factor(new DenseMatrix( A)); }
/** * Convenience method for computing a full SVD * * @param A * Matrix to decompose, not modified * @return Newly allocated factorization * @throws NotConvergedException */ public static SVD factorize(Matrix A) throws NotConvergedException { return new SVD(A.numRows(), A.numColumns()).factor(new DenseMatrix(A)); }
/** * Convenience method to compute a LQ decomposition * * @param A * Matrix to decompose. Not modified * @return Newly allocated decomposition */ public static LQ factorize(Matrix A) { return new LQ(A.numRows(), A.numColumns()).factor(new DenseMatrix(A)); }
/** * Convenience method for computing a full SVD * * @param A * Matrix to decompose, not modified * @return Newly allocated factorization * @throws NotConvergedException */ public static SVD factorize(Matrix A) throws NotConvergedException { return new SVD(A.numRows(), A.numColumns()).factor(new DenseMatrix(A)); }
/** * Creates an LU decomposition of the given matrix * * @param A * Matrix to decompose. Not modified * @return The current decomposition */ public static DenseLU factorize(Matrix A) { return new DenseLU(A.numRows(), A.numColumns()).factor(new DenseMatrix( A)); }
/** * Convenience method to compute an RQ decomposition * * @param A * Matrix to decompose. Not modified * @return Newly allocated decomposition */ public static RQ factorize(Matrix A) { return new RQ(A.numRows(), A.numColumns()).factor(new DenseMatrix(A)); }
public MTJDenseDoubleMatrix2D(Matrix m) { super(m.getRowCount(), m.getColumnCount()); if (m instanceof MTJDenseDoubleMatrix2D) { this.matrix = ((MTJDenseDoubleMatrix2D) m).matrix.copy(); } else { this.matrix = new DenseMatrix(m.toDoubleArray()); } if (m.getMetaData() != null) { setMetaData(m.getMetaData().clone()); } }