~logan/ubuntu/trusty/suitesparse/4.2.1-3ubuntu1

« back to all changes in this revision

Viewing changes to CHOLMOD/MATLAB/resymbol.c

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2007-05-29 09:36:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529093629-zowquo0b7slkk6nc
Tags: 3.0.0-2
* suitesparse builds properly twice in a row
* Bug fix: "suitesparse - FTBFS: Broken build depens: libgfortran1-dev",
  thanks to Bastian Blank (Closes: #426349).
* Bug fix: "suitesparse_3.0.0-1: FTBFS: build-depends on
  libgfortran1-dev", thanks to Steve Langasek (Closes: #426354).

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/* ========================================================================== */
4
4
 
5
5
/* -----------------------------------------------------------------------------
6
 
 * CHOLMOD/MATLAB Module.  Version 1.3.  Copyright (C) 2005-2006,
7
 
 * Timothy A. Davis
 
6
 * CHOLMOD/MATLAB Module.  Copyright (C) 2005-2006, Timothy A. Davis
8
7
 * The CHOLMOD/MATLAB Module is licensed under Version 2.0 of the GNU
9
8
 * General Public License.  See gpl.txt for a text of the license.
10
9
 * CHOLMOD is also available under other licenses; contact authors for details.
36
35
{
37
36
    double dummy = 0 ;
38
37
    double *Lx, *Lx2, *Lz, *Lz2 ;
39
 
    int *Li, *Lp, *Lnz2, *Li2, *Lp2, *ColCount ;
 
38
    Int *Li, *Lp, *Lnz2, *Li2, *Lp2, *ColCount ;
40
39
    cholmod_sparse *A, Amatrix, *Lsparse, *S ;
41
40
    cholmod_factor *L ;
42
41
    cholmod_common Common, *cm ;
43
 
    int j, s, n, lnz, is_complex ;
 
42
    Int j, s, n, lnz, is_complex ;
44
43
 
45
44
    /* ---------------------------------------------------------------------- */
46
45
    /* start CHOLMOD and set parameters */ 
47
46
    /* ---------------------------------------------------------------------- */
48
47
 
49
48
    cm = &Common ;
50
 
    cholmod_start (cm) ;
 
49
    cholmod_l_start (cm) ;
51
50
    sputil_config (SPUMONI, cm) ;
52
51
 
53
52
    /* ---------------------------------------------------------------------- */
68
67
    {
69
68
        mexErrMsgTxt ("resymbol: A and L must have same dimensions") ;
70
69
    }
71
 
    if (!mxIsDouble (pargin [0]))
72
 
    {
73
 
        mexErrMsgTxt ("resymbol: L must be double (or complex double)") ;
74
 
    }
75
70
 
76
71
    /* ---------------------------------------------------------------------- */
77
72
    /* get the sparse matrix A */
89
84
    /* ---------------------------------------------------------------------- */
90
85
 
91
86
    /* get the MATLAB L */
92
 
    Lp = mxGetJc (pargin [0]) ;
93
 
    Li = mxGetIr (pargin [0]) ;
 
87
    Lp = (Int *) mxGetJc (pargin [0]) ;
 
88
    Li = (Int *) mxGetIr (pargin [0]) ;
94
89
    Lx = mxGetPr (pargin [0]) ;
95
90
    Lz = mxGetPi (pargin [0]) ;
96
91
    is_complex = mxIsComplex (pargin [0]) ;
97
92
 
98
93
    /* allocate the CHOLMOD symbolic L */
99
 
    L = cholmod_allocate_factor (n, cm) ;
 
94
    L = cholmod_l_allocate_factor (n, cm) ;
100
95
    L->ordering = CHOLMOD_NATURAL ;
101
96
    ColCount = L->ColCount ;
102
97
    for (j = 0 ; j < n ; j++)
106
101
 
107
102
    /* allocate space for a CHOLMOD LDL' packed factor */
108
103
    /* (LL' and LDL' are treated identically) */
109
 
    cholmod_change_factor (is_complex ? CHOLMOD_ZOMPLEX : CHOLMOD_REAL,
 
104
    cholmod_l_change_factor (is_complex ? CHOLMOD_ZOMPLEX : CHOLMOD_REAL,
110
105
            FALSE, FALSE, TRUE, TRUE, L, cm) ;
111
106
 
112
107
    /* copy MATLAB L into CHOLMOD L */
144
139
    /* resymbolic factorization */
145
140
    /* ---------------------------------------------------------------------- */
146
141
 
147
 
    cholmod_resymbol (A, NULL, 0, TRUE, L, cm) ;
 
142
    cholmod_l_resymbol (A, NULL, 0, TRUE, L, cm) ;
148
143
 
149
144
    /* ---------------------------------------------------------------------- */
150
145
    /* copy the results back to MATLAB */
151
146
    /* ---------------------------------------------------------------------- */
152
147
 
153
 
    Lsparse = cholmod_factor_to_sparse (L, cm) ;
 
148
    Lsparse = cholmod_l_factor_to_sparse (L, cm) ;
154
149
 
155
150
    /* return L as a sparse matrix */
156
151
    pargout [0] = sputil_put_sparse (&Lsparse, cm) ;
159
154
    /* free workspace and the CHOLMOD L, except for what is copied to MATLAB */
160
155
    /* ---------------------------------------------------------------------- */
161
156
 
162
 
    cholmod_free_factor (&L, cm) ;
163
 
    cholmod_free_sparse (&S, cm) ;
164
 
    cholmod_finish (cm) ;
165
 
    cholmod_print_common (" ", cm) ;
 
157
    cholmod_l_free_factor (&L, cm) ;
 
158
    cholmod_l_free_sparse (&S, cm) ;
 
159
    cholmod_l_finish (cm) ;
 
160
    cholmod_l_print_common (" ", cm) ;
166
161
    /*
167
162
    if (cm->malloc_count != 3 + mxIsComplex (pargout[0])) mexErrMsgTxt ("!") ;
168
163
    */