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

« back to all changes in this revision

Viewing changes to CHOLMOD/MATLAB/etree2.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.
38
37
)
39
38
{
40
39
    double dummy = 0 ;
41
 
    int *Parent ;
 
40
    Int *Parent ;
42
41
    cholmod_sparse *A, Amatrix, *S ;
43
42
    cholmod_common Common, *cm ;
44
 
    int n, coletree, c ;
 
43
    Int n, coletree, c ;
45
44
    char buf [LEN] ;
46
45
 
47
46
    /* ---------------------------------------------------------------------- */
49
48
    /* ---------------------------------------------------------------------- */
50
49
 
51
50
    cm = &Common ;
52
 
    cholmod_start (cm) ;
 
51
    cholmod_l_start (cm) ;
53
52
    sputil_config (SPUMONI, cm) ;
54
53
 
55
54
    /* ---------------------------------------------------------------------- */
120
119
    /* compute the etree */
121
120
    /* ---------------------------------------------------------------------- */
122
121
 
123
 
    Parent = cholmod_malloc (n, sizeof (int), cm) ;
 
122
    Parent = cholmod_l_malloc (n, sizeof (Int), cm) ;
124
123
    if (A->stype == 1 || coletree)
125
124
    {
126
125
        /* symmetric case: find etree of A, using triu(A) */
127
126
        /* column case: find column etree of A, which is etree of A'*A */
128
 
        cholmod_etree (A, Parent, cm) ;
 
127
        cholmod_l_etree (A, Parent, cm) ;
129
128
    }
130
129
    else
131
130
    {
133
132
        /* row case: find row etree of A, which is etree of A*A' */
134
133
        /* R = A' */
135
134
        cholmod_sparse *R ;
136
 
        R = cholmod_transpose (A, 0, cm) ;
137
 
        cholmod_etree (R, Parent, cm) ;
138
 
        cholmod_free_sparse (&R, cm) ;
 
135
        R = cholmod_l_transpose (A, 0, cm) ;
 
136
        cholmod_l_etree (R, Parent, cm) ;
 
137
        cholmod_l_free_sparse (&R, cm) ;
139
138
    }
140
139
 
141
140
    if (cm->status < CHOLMOD_OK)
156
155
 
157
156
    if (nargout > 1)
158
157
    {
159
 
        int *Post ;
160
 
        Post = cholmod_malloc (n, sizeof (int), cm) ;
161
 
        if (cholmod_postorder (Parent, n, NULL, Post, cm) != n)
 
158
        Int *Post ;
 
159
        Post = cholmod_l_malloc (n, sizeof (Int), cm) ;
 
160
        if (cholmod_l_postorder (Parent, n, NULL, Post, cm) != n)
162
161
        {
163
162
            /* out of memory or Parent invalid */
164
163
            mexErrMsgTxt ("etree2 postorder failed!") ;
165
164
        }
166
165
        pargout [1] = sputil_put_int (Post, n, 1) ;
167
 
        cholmod_free (n, sizeof (int), Post, cm) ;
 
166
        cholmod_l_free (n, sizeof (Int), Post, cm) ;
168
167
    }
169
168
 
170
169
    /* ---------------------------------------------------------------------- */
171
170
    /* free workspace */
172
171
    /* ---------------------------------------------------------------------- */
173
172
 
174
 
    cholmod_free (n, sizeof (int), Parent, cm) ;
175
 
    cholmod_free_sparse (&S, cm) ;
176
 
    cholmod_finish (cm) ;
177
 
    cholmod_print_common (" ", cm) ;
 
173
    cholmod_l_free (n, sizeof (Int), Parent, cm) ;
 
174
    cholmod_l_free_sparse (&S, cm) ;
 
175
    cholmod_l_finish (cm) ;
 
176
    cholmod_l_print_common (" ", cm) ;
178
177
    /* if (cm->malloc_count != 0) mexErrMsgTxt ("!") ; */
179
178
}