7
7
#ifdef MATLAB_MEX_FILE
10
#define CS_VER 2 /* CSparse Version 2.2.2 */
10
#define CS_VER 2 /* CSparse Version 2.2.3 */
11
11
#define CS_SUBVER 2
13
#define CS_DATE "Sept 23, 2008" /* CSparse release date */
14
#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2008"
13
#define CS_DATE "Jan 20, 2009" /* CSparse release date */
14
#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2009"
16
16
/* --- primary CSparse routines and data structures ------------------------- */
17
17
typedef struct cs_sparse /* matrix in compressed-column or triplet form */
19
int nzmax ; /* maximum number of entries */
20
int m ; /* number of rows */
21
int n ; /* number of columns */
22
int *p ; /* column pointers (size n+1) or col indices (size nzmax) */
23
int *i ; /* row indices, size nzmax */
24
double *x ; /* numerical values, size nzmax */
25
int nz ; /* # of entries in triplet matrix, -1 for compressed-col */
19
int nzmax ; /* maximum number of entries */
20
int m ; /* number of rows */
21
int n ; /* number of columns */
22
int *p ; /* column pointers (size n+1) or col indices (size nzmax) */
23
int *i ; /* row indices, size nzmax */
24
double *x ; /* numerical values, size nzmax */
25
int nz ; /* # of entries in triplet matrix, -1 for compressed-col */
28
28
cs *cs_add (const cs *A, const cs *B, double alpha, double beta) ;
50
50
/* --- secondary CSparse routines and data structures ----------------------- */
51
51
typedef struct cs_symbolic /* symbolic Cholesky, LU, or QR analysis */
53
int *pinv ; /* inverse row perm. for QR, fill red. perm for Chol */
54
int *q ; /* fill-reducing column permutation for LU and QR */
53
int *pinv ; /* inverse row perm. for QR, fill red. perm for Chol */
54
int *q ; /* fill-reducing column permutation for LU and QR */
55
55
int *parent ; /* elimination tree for Cholesky and QR */
56
int *cp ; /* column pointers for Cholesky, row counts for QR */
56
int *cp ; /* column pointers for Cholesky, row counts for QR */
57
57
int *leftmost ; /* leftmost[i] = min(find(A(i,:))), for QR */
58
int m2 ; /* # of rows for QR, after adding fictitious rows */
58
int m2 ; /* # of rows for QR, after adding fictitious rows */
59
59
double lnz ; /* # entries in L for LU or Cholesky; in V for QR */
60
60
double unz ; /* # entries in U for LU; in R for QR */
63
63
typedef struct cs_numeric /* numeric Cholesky, LU, or QR factorization */
65
cs *L ; /* L for LU and Cholesky, V for QR */
66
cs *U ; /* U for LU, R for QR, not used for Cholesky */
67
int *pinv ; /* partial pivoting for LU */
68
double *B ; /* beta [0..n-1] for QR */
65
cs *L ; /* L for LU and Cholesky, V for QR */
66
cs *U ; /* U for LU, R for QR, not used for Cholesky */
67
int *pinv ; /* partial pivoting for LU */
68
double *B ; /* beta [0..n-1] for QR */
71
71
typedef struct cs_dmperm_results /* cs_dmperm or cs_scc output */
73
int *p ; /* size m, row permutation */
74
int *q ; /* size n, column permutation */
75
int *r ; /* size nb+1, block k is rows r[k] to r[k+1]-1 in A(p,q) */
76
int *s ; /* size nb+1, block k is cols s[k] to s[k+1]-1 in A(p,q) */
77
int nb ; /* # of blocks in fine dmperm decomposition */
73
int *p ; /* size m, row permutation */
74
int *q ; /* size n, column permutation */
75
int *r ; /* size nb+1, block k is rows r[k] to r[k+1]-1 in A(p,q) */
76
int *s ; /* size nb+1, block k is cols s[k] to s[k+1]-1 in A(p,q) */
77
int nb ; /* # of blocks in fine dmperm decomposition */
78
78
int rr [5] ; /* coarse row decomposition */
79
79
int cc [5] ; /* coarse column decomposition */