Examples of Dcs


Examples of edu.emory.mathcs.csparsej.tdouble.Dcs_common.Dcs

            System.out.println("Matrix not in compressed column form");
            return null;
        }
           
        // allocate a triplet matrix
        Dcs tripletDcs = Dcs_util.cs_spalloc(m, n, nzmax, false, true);
       
        for (j = 0; j < n; j++) {  // for all columns
                for (int row = Ap[j]; row < Ap[j + 1]; row++) {
                // triplet is: row, j, Ax[row]
                double value = Ax[row];
View Full Code Here

Examples of edu.emory.mathcs.csparsej.tdouble.Dcs_common.Dcs

     *            column-compressed matrix (A.p modified then restored)
     * @return strongly connected components, null on error
     */
    public static Dcsd cs_scc(Dcs A) {
        int n, i, k, b, nb = 0, top, xi[], pstack[], p[], r[], Ap[], ATp[], rcopy[], Blk[];
        Dcs AT;
        Dcsd D;
        if (!Dcs_util.CS_CSC(A))
            return (null); /* check inputs */
        n = A.n;
        Ap = A.p;
View Full Code Here

Examples of edu.emory.mathcs.csparsej.tdouble.Dcs_common.Dcs

     * @return C if successful, null on error
     */
    public static Dcs cs_compress(Dcs T) {
        int m, n, nz, p, k, Cp[], Ci[], w[], Ti[], Tj[];
        double Cx[], Tx[];
        Dcs C;
        if (!Dcs_util.CS_TRIPLET(T))
            return (null); /* check inputs */
        m = T.m;
        n = T.n;
        Ti = T.i;
View Full Code Here

Examples of edu.emory.mathcs.csparsej.tdouble.Dcs_common.Dcs

public class Dcs_negate {

    public static Dcs  cs_negate(Dcs A) {
        int p, j,  anz;
        int   m, n;
        Dcs C;
        if (!Dcs_util.CS_CSC(A) )
            return null; /* check inputs */
       
        m = A.m;             // number of rows
        n = A.n;  // number of columns
        anz = A.p[A.n]// non-zero elements of matrix A
       
        C = new Dcs();
        C.m = m;
        C.n = n;
        C.p = new int[n+1];   // column pointers
        C.i = new int[anz]; // row pointers
        C.x = new double[anz]; // values
View Full Code Here

Examples of edu.emory.mathcs.csparsej.tdouble.Dcs_common.Dcs

        S.q = Dcs_amd.cs_amd(order, A); /* fill-reducing ordering */
        if (order > 0 && S.q == null)
            return (null);
        if (qr) /* QR symbolic analysis */
        {
            Dcs C = order > 0 ? Dcs_permute.cs_permute(A, null, S.q, false) : A;
            S.parent = Dcs_etree.cs_etree(C, true); /* etree of C'*C, where C=A(:,q) */
            post = Dcs_post.cs_post(S.parent, n);
            S.cp = Dcs_counts.cs_counts(C, S.parent, post, true); /* col counts chol(C'*C) */
            ok = C != null && S.parent != null && S.cp != null && cs_vcount(C, S);
            if (ok)
View Full Code Here

Examples of edu.emory.mathcs.csparsej.tdouble.Dcs_common.Dcs

    }

    /* C = A + triu(A,1)' */
    private static Dcs make_sym(Dcs A) {
        Dcs AT, C;
        AT = Dcs_transpose.cs_transpose(A, true); /* AT = A' */
        Dcs_fkeep.cs_fkeep(AT, new Dropdiag(), null); /* drop diagonal entries from AT */
        C = Dcs_add.cs_add(A, AT, 1, 1); /* C = A+AT */
        return (C);
    }
View Full Code Here

Examples of edu.emory.mathcs.csparsej.tdouble.Dcs_common.Dcs

     * @param tol
     *            drop tolerance
     * @return problem
     */
    public static Dproblem get_problem(String fileName, double tol) {
        Dcs T, A, C;
        int sym, m, n, mn, nz1, nz2;
        Dproblem Prob;
        Prob = new Dproblem();
        T = Dcs_load.cs_load(fileName); /* load triplet matrix T from a file */
        Prob.A = A = Dcs_compress.cs_compress(T); /* A = compressed-column form of T */
 
View Full Code Here

Examples of edu.emory.mathcs.csparsej.tdouble.Dcs_common.Dcs

     * @param Prob
     *            problem
     * @return true if successful, false on error
     */
    public static boolean demo2(Dproblem Prob) {
        Dcs A, C;
        double b[], x[], resid[], t, tol;
        int k, m, n, order, nb, ns, r[], s[], rr[], sprank;
        boolean ok;
        Dcsd D;
        if (Prob == null)
View Full Code Here

Examples of edu.emory.mathcs.csparsej.tdouble.Dcs_common.Dcs

     * @param Prob
     *            problem
     * @return true if successful, false on error
     */
    public static boolean demo3(Dproblem Prob) {
        Dcs A, C, W = null, WW, WT, E = null, W2;
        int n, k, Li[], Lp[], Wi[], Wp[], p1, p2, p[] = null;
        boolean ok;
        double b[], x[], resid[], y[] = null, Lx[], Wx[], s, t, t1;
        Dcss S = null;
        Dcsn N = null;
View Full Code Here

Examples of edu.emory.mathcs.csparsej.tdouble.Dcs_common.Dcs

* @author Piotr Wendykier (piotr.wendykier@gmail.com)
*
*/
public class Dcs_demo1 {
    public static void main(String[] args) {
        Dcs T = null, A, Eye, AT, C, D;
        int i, m;
        if (args.length == 0) {
            throw new IllegalArgumentException("Usage: java edu.emory.mathcs.csparsej.tdouble.demo.Dcs_demo1 fileName");
        }
        T = Dcs_load.cs_load(args[0]); /* load triplet matrix T from file */
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.