/** * @param Q sparse symmetric positive definite matrix. Only its subdiagonal lower left part is relevant. */ public CholeskySparseFactorization(SparseDoubleMatrix2D Q, MatrixRescaler rescaler) { //ColtUtils.dumpSparseMatrix(Q); //log.debug(org.apache.commons.lang3.ArrayUtils.toString(Q.toArray())); this.dim = Q.rows(); this.Q = Q; this.rescaler = rescaler; }
/** * * @param Q sparse matrix diagonal in its left upper corner * @param digonalLength the number of diagonal elements * @throws Exception */ public CholeskyUpperDiagonalFactorization(SparseDoubleMatrix2D Q, int diagonalLength, MatrixRescaler rescaler) throws Exception{ this.dim = Q.rows(); this.Q = Q; if(diagonalLength < 0){ throw new IllegalArgumentException("DiagonalLength cannot be < 0"); } if(dim < diagonalLength){ throw new IllegalArgumentException("Dimension cannot be less than diagonalLength"); } this.diagonalLength = diagonalLength; this.rescaler = rescaler; }
public ColtSparseDoubleMatrix2D(SparseDoubleMatrix2D m) { super(m.rows(), m.columns()); this.matrix = m; }
public ColtSparseDoubleMatrix2D(SparseDoubleMatrix2D m) { super(m.rows(), m.columns()); this.matrix = m; }
public Matrix invSPD() { DoubleMatrix2D ret = new CholeskyDecomposition(matrix).solve(DoubleFactory2D.dense.identity(matrix.rows())); return new ColtDenseDoubleMatrix2D(ret); }
public Matrix invSPD() { DoubleMatrix2D ret = new CholeskyDecomposition(matrix).solve(DoubleFactory2D.dense.identity(matrix.rows())); return new ColtDenseDoubleMatrix2D(ret); }
public CFGSig(ControlFlowGraph cfg) { this.adjacencyMatrix = cfg.getAdjacencyMatrix(); this.vertexCount = cfg.getVertexCount(); this.edgeCount = cfg.getEdgeCount(); this.name = cfg.getIdentifier(false); this.stringSignature = ""; stringSignature += name + ";"; stringSignature += adjacencyMatrix.rows(); DoubleArrayList unused = new DoubleArrayList(); IntArrayList indices = null; for(int i=0; i<adjacencyMatrix.rows(); ++i) { DoubleMatrix1D row = adjacencyMatrix.viewRow(i); if(row.cardinality() > 0) { stringSignature += ";" + i + ":"; indices = new IntArrayList(); row.getNonZeros(indices, unused); for(int j=0; j<indices.size(); ++j) { if(j > 0) stringSignature += ","; stringSignature += indices.get(j); } } } // build sig from adjmat }
public static final Dcs_common.Dcs matrixToDcs(SparseDoubleMatrix2D A) { int m = A.rows();
m = A.rows(); n = A.columns();