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

« back to all changes in this revision

Viewing changes to AMD/MATLAB/amd_mex.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
 
/* AMD Version 2.0, Copyright (c) 2006 by Timothy A. Davis,                  */
 
6
/* AMD, Copyright (c) Timothy A. Davis,                                      */
7
7
/* Patrick R. Amestoy, and Iain S. Duff.  See ../README.txt for License.     */
8
8
/* email: davis at cise.ufl.edu    CISE Department, Univ. of Florida.        */
9
9
/* web: http://www.cise.ufl.edu/research/sparse/amd                          */
30
30
#include "amd.h"
31
31
#include "mex.h"
32
32
#include "matrix.h"
 
33
#include "UFconfig.h"
33
34
 
34
35
void mexFunction
35
36
(
39
40
    const mxArray *pargin [ ]
40
41
)
41
42
{
42
 
    int i, m, n, *Ap, *Ai, *P, nc, result, spumoni, full ;
43
 
    double *Pout, *InfoOut, Control [AMD_CONTROL], Info [AMD_INFO],
44
 
        *ControlIn ;
 
43
    UF_long i, m, n, *Ap, *Ai, *P, nc, result, spumoni, full ;
 
44
    double *Pout, *InfoOut, Control [AMD_CONTROL], Info [AMD_INFO], *ControlIn ;
45
45
    mxArray *A ;
46
46
 
47
47
    /* --------------------------------------------------------------------- */
59
59
    {
60
60
        /* get the default control parameters, and return */
61
61
        pargout [0] = mxCreateDoubleMatrix (AMD_CONTROL, 1, mxREAL) ;
62
 
        amd_defaults (mxGetPr (pargout [0])) ;
 
62
        amd_l_defaults (mxGetPr (pargout [0])) ;
63
63
        if (nargout == 0)
64
64
        {
65
 
            amd_control (mxGetPr (pargout [0])) ;
 
65
            amd_l_control (mxGetPr (pargout [0])) ;
66
66
        }
67
67
        return ;
68
68
    }
69
69
 
70
 
    amd_defaults (Control) ;
 
70
    amd_l_defaults (Control) ;
71
71
    if (nargin > 1)
72
72
    {
73
73
        ControlIn = mxGetPr (pargin [1]) ;
81
81
 
82
82
    if (spumoni > 0)
83
83
    {
84
 
        amd_control (Control) ;
 
84
        amd_l_control (Control) ;
85
85
    }
86
86
 
87
87
    /* --------------------------------------------------------------------- */
113
113
    /* allocate workspace for output permutation */
114
114
    /* --------------------------------------------------------------------- */
115
115
 
116
 
    P = mxMalloc ((n+1) * sizeof (int)) ;
 
116
    P = mxMalloc ((n+1) * sizeof (UF_long)) ;
117
117
 
118
118
    /* --------------------------------------------------------------------- */
119
119
    /* if A is full, convert to a sparse matrix */
129
129
        }
130
130
        mexCallMATLAB (1, &A, 1, (mxArray **) pargin, "sparse") ;
131
131
    }
132
 
    Ap = mxGetJc (A) ;
133
 
    Ai = mxGetIr (A) ;
 
132
    Ap = (UF_long *) mxGetJc (A) ;
 
133
    Ai = (UF_long *) mxGetIr (A) ;
134
134
    if (spumoni > 0)
135
135
    {
136
136
        mexPrintf ("    input matrix A has %d nonzero entries\n", Ap [n]) ;
140
140
    /* order the matrix */
141
141
    /* --------------------------------------------------------------------- */
142
142
 
143
 
    result = amd_order (n, Ap, Ai, P, Control, Info) ;
 
143
    result = amd_l_order (n, Ap, Ai, P, Control, Info) ;
144
144
 
145
145
    /* --------------------------------------------------------------------- */
146
146
    /* if A is full, free the sparse copy of A */
157
157
 
158
158
    if (spumoni > 0)
159
159
    {
160
 
        amd_info (Info) ;
 
160
        amd_l_info (Info) ;
161
161
    }
162
162
 
163
163
    /* --------------------------------------------------------------------- */