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

« back to all changes in this revision

Viewing changes to CHOLMOD/MATLAB/cholmod_matlab.h

  • 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:
4
4
 
5
5
/* Shared prototypes and definitions for CHOLMOD mexFunctions */
6
6
 
 
7
#include "UFconfig.h"
 
8
#ifndef DLONG
 
9
#define DLONG
 
10
#endif
 
11
#define Int UF_long
 
12
#define Int_max UF_long_max
 
13
 
 
14
/* Ensure cholmod_read_* and cholmod_write_* work for large files.  This
 
15
 * requires MATLAB 7.0 or later.  If you are using MATLAB 6.5 or earlier,
 
16
 * you must delete the following line, or compile CHOLMOD with -DNLARGEFILE */
 
17
#include "cholmod_io64.h"
 
18
 
7
19
#ifndef NPARTITION
8
20
#include "metis.h"
9
21
#endif
13
25
#include <limits.h>
14
26
#include <string.h>
15
27
#include <ctype.h>
 
28
#include <float.h>
16
29
#include "mex.h"
17
30
#define EMPTY (-1)
18
31
#define TRUE 1
39
52
 
40
53
void sputil_error   /* reports an error */
41
54
(
42
 
    int error,      /* kind of error */
43
 
    int is_index    /* TRUE if a matrix index, FALSE if a matrix dimension */
 
55
    Int error,  /* kind of error */
 
56
    Int is_index /* TRUE if a matrix index, FALSE if a matrix dimension */
44
57
) ;
45
58
 
46
 
int sputil_double_to_int   /* returns integer value of x */
 
59
Int sputil_double_to_int   /* returns integer value of x */
47
60
(
48
61
    double x,       /* double value to convert */
49
 
    int is_index,   /* TRUE if a matrix index, FALSE if a matrix dimension */
50
 
    int n           /* if a matrix index, x cannot exceed this dimension */
 
62
    Int is_index, /* TRUE if a matrix index, FALSE if a matrix dimension */
 
63
    Int n           /* if a matrix index, x cannot exceed this dimension */
51
64
) ;
52
65
 
53
66
double sputil_get_double (const mxArray *arg) ; /* like mxGetScalar */
54
67
 
55
 
int sputil_get_integer      /* returns the integer value of a MATLAB argument */
 
68
Int sputil_get_integer  /* returns the integer value of a MATLAB argument */
56
69
(
57
70
    const mxArray *arg,     /* MATLAB argument to convert */
58
 
    int is_index,           /* TRUE if an index, FALSE if a matrix dimension */
59
 
    int n                   /* maximum value, if an index */
 
71
    Int is_index,           /* TRUE if an index, FALSE if a matrix dimension */
 
72
    Int n                   /* maximum value, if an index */
60
73
) ;
61
74
 
62
75
 
63
 
int sputil_copy_ij    /* returns the dimension, n */
 
76
Int sputil_copy_ij    /* returns the dimension, n */
64
77
(
65
 
    int is_scalar,      /* TRUE if argument is a scalar, FALSE otherwise */
66
 
    int scalar,         /* scalar value of the argument */
 
78
    Int is_scalar,      /* TRUE if argument is a scalar, FALSE otherwise */
 
79
    Int scalar,         /* scalar value of the argument */
67
80
    void *vector,       /* vector value of the argument */
68
81
    mxClassID category, /* type of vector */
69
 
    int nz,             /* length of output vector I */
70
 
    int n,              /* maximum dimension, EMPTY if not yet known */
71
 
    int *I              /* vector of length nz to copy into */
 
82
    Int nz,             /* length of output vector I */
 
83
    Int n,              /* maximum dimension, EMPTY if not yet known */
 
84
    Int *I              /* vector of length nz to copy into */
72
85
) ;
73
86
 
74
87
/* converts a triplet matrix to a compressed-column matrix */
75
88
cholmod_sparse *sputil_triplet_to_sparse
76
89
(
77
 
    int nrow, int ncol, int nz, int nzmax,
78
 
    int i_is_scalar, int i, void *i_vector, mxClassID i_class,
79
 
    int j_is_scalar, int j, void *j_vector, mxClassID j_class,
80
 
    int s_is_scalar, double x, double z, void *x_vector, double *z_vector,
81
 
    mxClassID s_class, int s_complex,
 
90
    Int nrow, Int ncol, Int nz, Int nzmax,
 
91
    Int i_is_scalar, Int i, void *i_vector, mxClassID i_class,
 
92
    Int j_is_scalar, Int j, void *j_vector, mxClassID j_class,
 
93
    Int s_is_scalar, double x, double z, void *x_vector, double *z_vector,
 
94
    mxClassID s_class, Int s_complex,
82
95
    cholmod_common *cm
83
96
) ;
84
97
 
85
98
mxArray *sputil_copy_sparse (const mxArray *A) ;    /* copy a sparse matrix */
86
99
 
87
 
int sputil_nelements (const mxArray *arg) ; /* like mxGetNumberOfElements */
 
100
Int sputil_nelements (const mxArray *arg) ; /* like mxGetNumberOfElements */
88
101
 
89
102
void sputil_sparse              /* top-level wrapper for "sparse" function */
90
103
(
96
109
 
97
110
void sputil_error_handler (int status, char *file, int line, char *message) ;
98
111
 
99
 
void sputil_config (int spumoni, cholmod_common *cm) ;
 
112
void sputil_config (Int spumoni, cholmod_common *cm) ;
100
113
 
101
114
mxArray *sputil_sparse_to_dense (const mxArray *S) ;
102
115
 
105
118
    const mxArray *Amatlab, /* MATLAB version of the matrix */
106
119
    cholmod_sparse *A,      /* CHOLMOD version of the matrix */
107
120
    double *dummy,          /* a pointer to a valid scalar double */
108
 
    int stype               /* -1: lower, 0: unsymmetric, 1: upper */
 
121
    Int stype               /* -1: lower, 0: unsymmetric, 1: upper */
109
122
) ;
110
123
 
111
124
cholmod_dense *sputil_get_dense
132
145
    cholmod_sparse *S
133
146
) ;
134
147
 
135
 
mxArray *sputil_put_int /* copy int vector to mxArray */
 
148
mxArray *sputil_put_int /* copy Int vector to mxArray */
136
149
(
137
 
    int *P,             /* vector to convert */
138
 
    int n,              /* length of P */
139
 
    int one_based       /* 1 if convert from 0-based to 1-based, 0 otherwise */
 
150
    Int *P,             /* vector to convert */
 
151
    Int n,              /* length of P */
 
152
    Int one_based       /* 1 if convert from 0-based to 1-based, 0 otherwise */
140
153
) ;
141
154
 
142
155
mxArray *sputil_dense_to_sparse (const mxArray *arg) ;
146
159
void sputil_trim
147
160
(
148
161
    cholmod_sparse *S,
149
 
    int k,
 
162
    Int k,
150
163
    cholmod_common *cm
151
164
) ;
152
165