~ubuntu-branches/ubuntu/natty/suitesparse/natty

« back to all changes in this revision

Viewing changes to CHOLMOD/MATLAB/mread.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.
45
44
    cholmod_sparse *A = NULL, *Z = NULL ;
46
45
    cholmod_triplet *T ;
47
46
    cholmod_common Common, *cm ;
48
 
    int *Ti, *Tj, *Ap, *Ai, *Zp, *Zi ;
 
47
    Int *Ti, *Tj, *Ap, *Ai, *Zp, *Zi ;
49
48
    double *Tx, *Tz, *Ax, *Az, *Zx ;
50
49
    char filename [MAXLEN] ;
51
 
    int nz, i, j, k, is_complex, p, nrow, ncol, pz, nzeros, mtype, allzero ;
 
50
    Int nz, i, j, k, is_complex, p, nrow, ncol, pz, nzeros, allzero ;
 
51
    int mtype ;
52
52
 
53
53
    /* ---------------------------------------------------------------------- */
54
54
    /* start CHOLMOD and set parameters */ 
55
55
    /* ---------------------------------------------------------------------- */
56
56
 
57
57
    cm = &Common ;
58
 
    cholmod_start (cm) ;
 
58
    cholmod_l_start (cm) ;
59
59
    sputil_config (SPUMONI, cm) ;
60
60
 
61
61
    /* ---------------------------------------------------------------------- */
85
85
    /* read the matrix, as either a dense or sparse matrix */
86
86
    /* ---------------------------------------------------------------------- */
87
87
 
88
 
    G = cholmod_read_matrix (sputil_file, 1, &mtype, cm) ;
 
88
    G = cholmod_l_read_matrix (sputil_file, 1, &mtype, cm) ;
89
89
    fclose (sputil_file) ;
90
90
    sputil_file = NULL ;
91
91
    if (G == NULL)
105
105
        if (is_complex)
106
106
        {
107
107
            /* if complex, ensure A is ZOMPLEX */
108
 
            cholmod_sparse_xtype (CHOLMOD_ZOMPLEX, A, cm) ;
 
108
            cholmod_l_sparse_xtype (CHOLMOD_ZOMPLEX, A, cm) ;
109
109
        }
110
110
        Ax = A->x ;
111
111
        Az = A->z ;
119
119
        if (is_complex)
120
120
        {
121
121
            /* if complex, ensure X is ZOMPLEX */
122
 
            cholmod_dense_xtype (CHOLMOD_ZOMPLEX, X, cm) ;
 
122
            cholmod_l_dense_xtype (CHOLMOD_ZOMPLEX, X, cm) ;
123
123
        }
124
124
        Ax = X->x ;
125
125
        Az = X->z ;
143
143
        else
144
144
        {
145
145
            /* input is full; just return an empty Z matrix */
146
 
            Z = cholmod_spzeros (nrow, ncol, 0, CHOLMOD_REAL, cm) ;
 
146
            Z = cholmod_l_spzeros (nrow, ncol, 0, CHOLMOD_REAL, cm) ;
147
147
        }
148
148
    }
149
149
 
154
154
    if (mtype == CHOLMOD_SPARSE)
155
155
    {
156
156
        sputil_drop_zeros (A) ;
157
 
        cholmod_reallocate_sparse (cholmod_nnz (A, cm), A, cm) ;
 
157
        cholmod_l_reallocate_sparse (cholmod_l_nnz (A, cm), A, cm) ;
158
158
    }
159
159
 
160
160
    /* ---------------------------------------------------------------------- */
185
185
            /* discard the all-zero imaginary part */
186
186
            if (mtype == CHOLMOD_SPARSE)
187
187
            {
188
 
                cholmod_sparse_xtype (CHOLMOD_REAL, A, cm) ;
 
188
                cholmod_l_sparse_xtype (CHOLMOD_REAL, A, cm) ;
189
189
            }
190
190
            else
191
191
            {
192
 
                cholmod_dense_xtype (CHOLMOD_REAL, X, cm) ;
 
192
                cholmod_l_dense_xtype (CHOLMOD_REAL, X, cm) ;
193
193
            }
194
194
        }
195
195
    }
215
215
    /* free workspace */
216
216
    /* ---------------------------------------------------------------------- */
217
217
 
218
 
    cholmod_finish (cm) ;
219
 
    cholmod_print_common (" ", cm) ;
 
218
    cholmod_l_finish (cm) ;
 
219
    cholmod_l_print_common (" ", cm) ;
220
220
}