82 if (stype != 0 && nrow != ncol)
110 PRINT1 ((
"cholmod_allocate_sparse %d-by-%d nzmax %d sorted %d packed %d"
111 " xtype %d\n", nrow, ncol, nzmax, sorted, packed, xtype)) ;
113 nzmax =
MAX (1, nzmax) ;
138 A->
p =
CHOLMOD(malloc) (((size_t) ncol)+1,
sizeof (
Int), Common) ;
160 for (j = 0 ; j <= (
Int) ncol ; j++)
167 for (j = 0 ; j < (
Int) ncol ; j++)
211 A->
p =
CHOLMOD(free) (n+1,
sizeof (
Int), A->
p, Common) ;
218 A->
x =
CHOLMOD(free) (nz,
sizeof (double), A->
x, Common) ;
222 A->
x =
CHOLMOD(free) (nz, 2*
sizeof (double), A->
x, Common) ;
226 A->
x =
CHOLMOD(free) (nz,
sizeof (double), A->
x, Common) ;
227 A->
z =
CHOLMOD(free) (nz,
sizeof (double), A->
z, Common) ;
266 PRINT1 ((
"realloc matrix %d to %d, xtype: %d\n",
267 A->nzmax, nznew,
A->xtype)) ;
274 &(
A->x), &(
A->z), &(
A->nzmax), Common) ;
312 n =
MIN (nrow, ncol) ;
330 for (j = 0 ; j < n ; j++)
334 for (j = n ; j <= ((
Int) ncol) ; j++)
338 for (j = 0 ; j < n ; j++)
346 for (j = 0 ; j < n ; j++)
353 for (j = 0 ; j < n ; j++)
361 for (j = 0 ; j < n ; j++)
365 for (j = 0 ; j < n ; j++)
457 for (j = 0 ; j < ncol ; j++)
459 nz +=
MAX (0, Anz [j]) ;
489 double *Ax, *Cx, *Az, *Cz ;
490 Int *Ap, *Ai, *Anz, *Cp, *Ci, *Cnz ;
492 Int p, pend, j, ncol, packed, nzmax, nz, xtype ;
507 ASSERT (
CHOLMOD(dump_sparse) (A,
"A original", Common) >= 0) ;
545 for (j = 0 ; j <= ncol ; j++)
553 for (p = 0 ; p < nz ; p++)
561 for (p = 0 ; p < nz ; p++)
568 for (p = 0 ; p < 2*nz ; p++)
575 for (p = 0 ; p < nz ; p++)
587 for (j = 0 ; j < ncol ; j++)
595 for (j = 0 ; j < ncol ; j++)
599 for ( ; p < pend ; p++)
607 for (j = 0 ; j < ncol ; j++)
611 for ( ; p < pend ; p++)
620 for (j = 0 ; j < ncol ; j++)
624 for ( ; p < pend ; p++)
627 Cx [2*p ] = Ax [2*p ] ;
628 Cx [2*p+1] = Ax [2*p+1] ;
634 for (j = 0 ; j < ncol ; j++)
638 for ( ; p < pend ; p++)
#define CHOLMOD_TOO_LARGE
UF_long CHOLMOD() nnz(cholmod_sparse *A, cholmod_common *Common)
int CHOLMOD() realloc_multiple(size_t nnew, int nint, int xtype, void **I, void **J, void **X, void **Z, size_t *nold_p, cholmod_common *Common)
size_t CHOLMOD() add_size_t(size_t a, size_t b, int *ok)
int CHOLMOD() reallocate_sparse(size_t nznew, cholmod_sparse *A, cholmod_common *Common)
#define RETURN_IF_NULL_COMMON(result)
int CHOLMOD() free_sparse(cholmod_sparse **AHandle, cholmod_common *Common)
#define ASSERT(expression)
cholmod_sparse *CHOLMOD() spzeros(size_t nrow, size_t ncol, size_t nzmax, int xtype, cholmod_common *Common)
cholmod_sparse *CHOLMOD() copy_sparse(cholmod_sparse *A, cholmod_common *Common)
cholmod_sparse *CHOLMOD() allocate_sparse(size_t nrow, size_t ncol, size_t nzmax, int sorted, int packed, int stype, int xtype, cholmod_common *Common)
struct cholmod_sparse_struct cholmod_sparse
#define RETURN_IF_NULL(A, result)
cholmod_sparse *CHOLMOD() speye(size_t nrow, size_t ncol, int xtype, cholmod_common *Common)
#define ERROR(status, msg)
#define RETURN_IF_XTYPE_INVALID(A, xtype1, xtype2, result)