Matrix  $Rev: 3071 $ at $LastChangedDate: 2015-03-26 15:35:47 +0100 (Thu, 26 Mar 2015) $
chm_common.c File Reference
#include "chm_common.h"
Include dependency graph for chm_common.c:

Go to the source code of this file.

Macros

#define _AS_cholmod_dense_1
 
#define _AS_cholmod_dense_2
 
#define _i(I)   ( (int*) chx->i)[I]
 
#define _p(I)   ( (int*) chx->p)[I]
 
#define _x(I)   ((double*) chx->x)[I]
 
#define CHM_DENSE_COPY_DATA
 
#define CHM_DENSE_TYPE
 
#define DOFREE_de_MAYBE
 
#define DOFREE_MAYBE
 
#define DOFREE_MAYBE
 
#define DOFREE_MAYBE
 

Functions

CHM_DN as_cholmod_dense (CHM_DN ans, SEXP x)
 Populate ans with the pointers from x and modify its scalar elements accordingly. More...
 
CHM_FR as_cholmod_factor (CHM_FR ans, SEXP x)
 Populate ans with the pointers from x and modify its scalar elements accordingly. More...
 
CHM_SP as_cholmod_sparse (CHM_SP ans, SEXP x, Rboolean check_Udiag, Rboolean sort_in_place)
 Populate ans with the pointers from x and modify its scalar elements accordingly. More...
 
CHM_TR as_cholmod_triplet (CHM_TR ans, SEXP x, Rboolean check_Udiag)
 Populate ans with the pointers from x and modify its scalar elements accordingly. More...
 
CHM_DN as_cholmod_x_dense (CHM_DN ans, SEXP x)
 
Rboolean check_sorted_chm (CHM_SP A)
 
static void chm2Ralloc (CHM_SP dest, CHM_SP src)
 Copy cholmod_sparse, to an R_alloc()ed version of it. More...
 
SEXP chm_dense_to_matrix (CHM_DN a, int dofree, SEXP dn)
 Copy the contents of a to a matrix object and, optionally, free a or free both a and its pointer to its contents. More...
 
SEXP chm_dense_to_SEXP (CHM_DN a, int dofree, int Rkind, SEXP dn, Rboolean transp)
 Copy the contents of a to an appropriate denseMatrix object and, optionally, free a or free both a and its pointer to its contents. More...
 
SEXP chm_dense_to_vector (CHM_DN a, int dofree)
 Copy the contents of a to a numeric R object and, optionally, free a or free both a and its pointer to its contents. More...
 
void chm_diagN2U (CHM_SP chx, int uploT, Rboolean do_realloc)
 Drop the (unit) diagonal entries from a cholmod_sparse matrix. More...
 
SEXP chm_factor_to_SEXP (CHM_FR f, int dofree)
 Copy the contents of f to an appropriate CHMfactor object and, optionally, free f or free both f and its pointer to its contents. More...
 
Rboolean chm_MOD_xtype (int to_xtype, cholmod_sparse *A, CHM_CM Common)
 Change the "type" of a cholmod_sparse matrix, i.e. More...
 
void CHM_restore_common ()
 
SEXP CHM_set_common_env (SEXP rho)
 
SEXP chm_sparse_to_SEXP (CHM_SP a, int dofree, int uploT, int Rkind, const char *diag, SEXP dn)
 Copy the contents of a to an appropriate CsparseMatrix object and, optionally, free a or free both a and its the pointers to its contents. More...
 
void CHM_store_common ()
 
void chm_transpose_dense (CHM_DN ans, CHM_DN x)
 Transpose a cholmod_dense matrix ("too trivial to be in CHOLMOD?") More...
 
SEXP chm_triplet_to_SEXP (CHM_TR a, int dofree, int uploT, int Rkind, const char *diag, SEXP dn)
 Copy the contents of a to an appropriate TsparseMatrix object and, optionally, free a or free both a and its the pointers to its contents. More...
 
SEXP CHMfactor_validate (SEXP obj)
 
SEXP CHMsimpl_validate (SEXP obj)
 
SEXP CHMsuper_validate (SEXP obj)
 
static void chTr2Ralloc (CHM_TR dest, CHM_TR src)
 Copy cholmod_triplet to an R_alloc()ed version of it. More...
 
SEXP get_SuiteSparse_version ()
 
Rboolean isValid_Csparse (SEXP x)
 "Cheap" C version of Csparse_validate() - not sorting : More...
 
CHM_DN numeric_as_chm_dense (CHM_DN ans, double *v, int nr, int nc)
 
void R_cholmod_error (int status, const char *file, int line, const char *message)
 
static int R_cholmod_printf (const char *fmt,...)
 
int R_cholmod_start (CHM_CM c)
 Initialize the CHOLMOD library and replace the print and error functions by R-specific versions. More...
 
static void * RallocedREAL (SEXP x)
 
static int stype (int ctype, SEXP x)
 stype := "symmetry type". More...
 
static void * xpt (int ctype, SEXP x)
 
static int xtype (int ctype)
 xtype: the kind of numeric (think "x slot") of Cholmod sparse matrices. More...
 

Variables

cholmod_common c
 
SEXP chm_common_env
 
cholmod_common cl
 
static SEXP dboundSym
 
static SEXP final_asisSym
 
static SEXP final_llSym
 
static SEXP final_monotonicSym
 
static SEXP final_packSym
 
static SEXP final_resymbolSym
 
static SEXP final_superSym
 
static SEXP grow0Sym
 
static SEXP grow1Sym
 
static SEXP grow2Sym
 
static SEXP m0_ordSym
 
static SEXP maxrankSym
 
static SEXP nmethodsSym
 
static SEXP postorderSym
 
static SEXP prefer_upperSym
 
static SEXP prefer_zomplexSym
 
static SEXP quick_return_if_not_posdefSym
 
static SEXP supernodal_switchSym
 
static SEXP supernodalSym
 

Macro Definition Documentation

#define _AS_cholmod_dense_1
Value:
static const char *valid[] = { MATRIX_VALID_ge_dense, ""}; \
int dims[2], ctype = R_check_class_etc(x, valid), nprot = 0; \
\
if (ctype < 0) { /* not a classed matrix */ \
if (isMatrix(x)) Memcpy(dims, INTEGER(getAttrib(x, R_DimSymbol)), 2); \
else {dims[0] = LENGTH(x); dims[1] = 1;} \
if (isInteger(x)) { \
x = PROTECT(coerceVector(x, REALSXP)); \
nprot++; \
} \
ctype = (isReal(x) ? 0 : \
(isLogical(x) ? 2 : /* logical -> default to "l", not "n" */ \
(isComplex(x) ? 6 : -1))); \
} else Memcpy(dims, INTEGER(GET_SLOT(x, Matrix_DimSym)), 2); \
if (ctype < 0) error(_("invalid class of object to as_cholmod_dense")); \
memset(ans, 0, sizeof(cholmod_dense)); /* zero the struct */ \
\
ans->dtype = CHOLMOD_DOUBLE; /* characteristics of the system */ \
ans->x = ans->z = (void *) NULL; \
/* dimensions and nzmax */ \
ans->d = ans->nrow = dims[0]; \
ans->ncol = dims[1]; \
ans->nzmax = ((size_t)dims[0]) * dims[1]; \
/* set the xtype and any elements */ \
switch(ctype / 2) { \
case 0: /* "d" */ \
ans->xtype = CHOLMOD_REAL; \
ans->x = (void *) REAL((ctype % 2) ? GET_SLOT(x, Matrix_xSym) : x); \
break
SEXP Matrix_DimSym
Definition: Syms.h:2
SEXP Matrix_xSym
Definition: Syms.h:2
CHM_DN as_cholmod_dense(CHM_DN ans, SEXP x)
Populate ans with the pointers from x and modify its scalar elements accordingly. ...
Definition: chm_common.c:672
#define _(String)
Definition: Mutils.h:32
#define MATRIX_VALID_ge_dense
Definition: Mutils.h:349

Referenced by as_cholmod_dense(), and as_cholmod_x_dense().

#define _AS_cholmod_dense_2
Value:
case 3: /* "z" */ \
ans->xtype = CHOLMOD_COMPLEX; \
ans->x = (void *) COMPLEX((ctype % 2) ? GET_SLOT(x, Matrix_xSym) : x); \
break; \
} \
UNPROTECT(nprot); \
return ans
SEXP Matrix_xSym
Definition: Syms.h:2

Referenced by as_cholmod_dense(), and as_cholmod_x_dense().

#define _i (   I)    ( (int*) chx->i)[I]

Referenced by chm_diagN2U().

#define _p (   I)    ( (int*) chx->p)[I]

Referenced by chm_diagN2U().

#define _x (   I)    ((double*) chx->x)[I]

Referenced by chm_diagN2U().

#define CHM_DENSE_COPY_DATA
Value:
if (a->d == a->nrow) { /* copy data slot if present */ \
if (a->xtype == CHOLMOD_REAL) \
Memcpy(REAL(ans), (double *) a->x, a->nrow * a->ncol); \
else if (a->xtype == CHOLMOD_COMPLEX) { \
DOFREE_de_MAYBE; \
error(_("complex sparse matrix code not yet written")); \
/* Memcpy(COMPLEX(ALLOC_SLOT(ans, Matrix_xSym, CPLXSXP, a->nnz)), */ \
/* (complex *) a->x, a->nz); */ \
} else if (a->xtype == CHOLMOD_PATTERN) { \
DOFREE_de_MAYBE; \
error(_("don't know if a dense pattern matrix makes sense")); \
} \
} else { \
error(_("code for cholmod_dense with holes not yet written")); \
}
#define _(String)
Definition: Mutils.h:32
#define DOFREE_de_MAYBE

Referenced by chm_dense_to_matrix(), and chm_dense_to_vector().

#define CHM_DENSE_TYPE
Value:
SEXPTYPE typ; \
/* determine the class of the result */ \
typ = (a->xtype == CHOLMOD_PATTERN) ? LGLSXP : \
((a->xtype == CHOLMOD_REAL) ? REALSXP : \
((a->xtype == CHOLMOD_COMPLEX) ? CPLXSXP : NILSXP)); \
if (typ == NILSXP) { \
error(_("unknown xtype")); \
}
#define _(String)
Definition: Mutils.h:32
#define DOFREE_de_MAYBE

Referenced by chm_dense_to_matrix(), and chm_dense_to_vector().

#define DOFREE_de_MAYBE
Value:
if (dofree > 0) cholmod_free_dense(&a, &c); \
else if (dofree < 0) Free(a);
cholmod_common c
Definition: chm_common.c:15

Referenced by chm_dense_to_matrix(), chm_dense_to_SEXP(), and chm_dense_to_vector().

#define DOFREE_MAYBE
Value:
if (dofree > 0) \
longi ? cholmod_l_free_sparse(&a, &cl) : cholmod_free_sparse(&a, &c); \
else if (dofree < 0) Free(a)
cholmod_common cl
Definition: chm_common.c:16
cholmod_common c
Definition: chm_common.c:15

Referenced by chm_factor_to_SEXP(), chm_sparse_to_SEXP(), and chm_triplet_to_SEXP().

#define DOFREE_MAYBE
Value:
if (dofree > 0) cholmod_free_triplet(&a, &c); \
else if (dofree < 0) Free(a)
cholmod_common c
Definition: chm_common.c:15
#define DOFREE_MAYBE
Value:
if(dofree) { \
if (dofree > 0) cholmod_free_factor(&f, &c); \
else /* dofree < 0 */ Free(f); \
}
cholmod_common c
Definition: chm_common.c:15

Function Documentation

CHM_DN as_cholmod_dense ( CHM_DN  ans,
SEXP  x 
)

Populate ans with the pointers from x and modify its scalar elements accordingly.

Note that later changes to the contents of ans will change the contents of the SEXP.

In most cases this function is called through the macro AS_CHM_DN. It is unusual to call it directly.

Parameters
ansa CHM_DN pointer.
xpointer to an object that inherits from (denseMatrix ^ generalMatrix)
Returns
ans containing pointers to the slots of x.

Definition at line 672 of file chm_common.c.

References _AS_cholmod_dense_1, _AS_cholmod_dense_2, Matrix_xSym, and RallocedREAL().

Referenced by R_init_Matrix().

Here is the call graph for this function:

Here is the caller graph for this function:

CHM_FR as_cholmod_factor ( CHM_FR  ans,
SEXP  x 
)

Populate ans with the pointers from x and modify its scalar elements accordingly.

Note that later changes to the contents of ans will change the contents of the SEXP.

In most cases this function is called through the macro AS_CHM_FR. It is unusual to call it directly.

Parameters
ansan CHM_FR object
xpointer to an object that inherits from CHMfactor
Returns
ans containing pointers to the slots of x.

Definition at line 1031 of file chm_common.c.

References _, c, Matrix_iSym, Matrix_permSym, Matrix_pSym, MATRIX_VALID_CHMfactor, and Matrix_xSym.

Referenced by R_init_Matrix().

Here is the caller graph for this function:

CHM_SP as_cholmod_sparse ( CHM_SP  ans,
SEXP  x,
Rboolean  check_Udiag,
Rboolean  sort_in_place 
)

Populate ans with the pointers from x and modify its scalar elements accordingly.

Note that later changes to the contents of ans will change the contents of the SEXP.

In most cases this function is called through the macros AS_CHM_SP() or AS_CHM_SP__(). It is unusual to call it directly.

Parameters
ansa CHM_SP pointer
xpointer to an object that inherits from CsparseMatrix
check_Udiagboolean - should a check for (and consequent expansion of) a unit diagonal be performed.
sort_in_placeboolean - if the i and x slots are to be sorted should they be sorted in place? If the i and x slots are pointers to an input SEXP they should not be modified.
Returns
ans containing pointers to the slots of x, unless check_Udiag and x is unitriangular.

Definition at line 245 of file chm_common.c.

References _, c, check_sorted_chm(), chm2Ralloc(), diag_P, isValid_Csparse(), Matrix_DimSym, Matrix_iSym, Matrix_pSym, MATRIX_VALID_Csparse, stype(), xpt(), and xtype().

Referenced by CSPARSE_VAL_FN_NAME(), and R_init_Matrix().

Here is the call graph for this function:

Here is the caller graph for this function:

CHM_TR as_cholmod_triplet ( CHM_TR  ans,
SEXP  x,
Rboolean  check_Udiag 
)

Populate ans with the pointers from x and modify its scalar elements accordingly.

Note that later changes to the contents of ans will change the contents of the SEXP.

In most cases this function is called through the macros AS_CHM_TR() or AS_CHM_TR__(). It is unusual to call it directly.

Parameters
ansa CHM_TR pointer
xpointer to an object that inherits from TsparseMatrix
check_Udiagboolean - should a check for (and consequent expansion of) a unit diagonal be performed.
Returns
ans containing pointers to the slots of x, unless check_Udiag and x is unitriangular.

Definition at line 480 of file chm_common.c.

References _, c, chTr2Ralloc(), diag_P, Matrix_DimSym, Matrix_iSym, Matrix_jSym, MATRIX_VALID_Tsparse, stype(), xpt(), and xtype().

Referenced by R_init_Matrix().

Here is the call graph for this function:

Here is the caller graph for this function:

CHM_DN as_cholmod_x_dense ( CHM_DN  ans,
SEXP  x 
)

Definition at line 731 of file chm_common.c.

References _AS_cholmod_dense_1, _AS_cholmod_dense_2, Matrix_xSym, and RallocedREAL().

Here is the call graph for this function:

Rboolean check_sorted_chm ( CHM_SP  A)

Definition at line 169 of file chm_common.c.

Referenced by as_cholmod_sparse().

Here is the caller graph for this function:

static void chm2Ralloc ( CHM_SP  dest,
CHM_SP  src 
)
static

Copy cholmod_sparse, to an R_alloc()ed version of it.

Definition at line 186 of file chm_common.c.

References c.

Referenced by as_cholmod_sparse().

Here is the caller graph for this function:

SEXP chm_dense_to_matrix ( CHM_DN  a,
int  dofree,
SEXP  dn 
)

Copy the contents of a to a matrix object and, optionally, free a or free both a and its pointer to its contents.

Parameters
acholmod_dense structure to be converted {already REAL for original l..CMatrix}
dofree0 - don't free a; > 0 cholmod_free a; < 0 Free a
dneither R_NilValue or an SEXP suitable for the Dimnames slot.
Returns
SEXP containing a copy of a as a matrix object

Definition at line 942 of file chm_common.c.

References CHM_DENSE_COPY_DATA, CHM_DENSE_TYPE, and DOFREE_de_MAYBE.

Referenced by Csparse_to_matrix().

Here is the caller graph for this function:

SEXP chm_dense_to_SEXP ( CHM_DN  a,
int  dofree,
int  Rkind,
SEXP  dn,
Rboolean  transp 
)

Copy the contents of a to an appropriate denseMatrix object and, optionally, free a or free both a and its pointer to its contents.

Parameters
amatrix to be converted
dofree0 - don't free a; > 0 cholmod_free a; < 0 Free a
Rkindtype of R matrix to be generated (special to this function)
dn– dimnames [list(.,.) or NULL; already transposed when transp is TRUE ]
transpRboolean, if TRUE, the result must be a copy of t(a), i.e., "a transposed"
Returns
SEXP containing a copy of a

Definition at line 835 of file chm_common.c.

References _, ALLOC_SLOT(), cl, DOFREE_de_MAYBE, Matrix_DimNamesSym, Matrix_DimSym, and Matrix_xSym.

Referenced by CHMfactor_solve(), Csparse_to_dense(), and dsCMatrix_matrix_solve().

Here is the call graph for this function:

Here is the caller graph for this function:

SEXP chm_dense_to_vector ( CHM_DN  a,
int  dofree 
)

Copy the contents of a to a numeric R object and, optionally, free a or free both a and its pointer to its contents.

Parameters
acholmod_dense structure to be converted
dofree0 - don't free a; > 0 cholmod_free a; < 0 Free a
Returns
SEXP containing a copy of a in the sense of as.vector(a)

Definition at line 996 of file chm_common.c.

References CHM_DENSE_COPY_DATA, CHM_DENSE_TYPE, and DOFREE_de_MAYBE.

Referenced by Csparse_to_vector().

Here is the caller graph for this function:

void chm_diagN2U ( CHM_SP  chx,
int  uploT,
Rboolean  do_realloc 
)

Drop the (unit) diagonal entries from a cholmod_sparse matrix.

Parameters
chxcholmod_sparse matrix. Note that the matrix "slots" are modified in place
uploTinteger code (= +/- 1) indicating if chx is upper (+1) or lower (-1) triangular
do_reallocRboolean indicating, if a cholmod_sprealloc() should finalize the procedure; not needed, e.g. when the result is converted to a SEXP immediately afterwards.

Definition at line 1191 of file chm_common.c.

References _, _i, _p, _x, and c.

Referenced by Csparse_Csparse_crossprod(), and Csparse_Csparse_prod().

Here is the caller graph for this function:

SEXP chm_factor_to_SEXP ( CHM_FR  f,
int  dofree 
)

Copy the contents of f to an appropriate CHMfactor object and, optionally, free f or free both f and its pointer to its contents.

Parameters
fcholmod_factor object to be converted
dofree0 - don't free a; > 0 cholmod_free a; < 0 Free a
Returns
SEXP containing a copy of a

Definition at line 1106 of file chm_common.c.

References _, ALLOC_SLOT(), chm_factor_ok(), DOFREE_MAYBE, Matrix_iSym, Matrix_pSym, Matrix_xSym, and xtype().

Referenced by CHMfactor_update(), CHMfactor_updown(), destructive_CHM_update(), dgCMatrix_cholsol(), dsCMatrix_Cholesky(), internal_chm_factor(), and R_init_Matrix().

Here is the call graph for this function:

Here is the caller graph for this function:

Rboolean chm_MOD_xtype ( int  to_xtype,
cholmod_sparse *  A,
CHM_CM  Common 
)

Change the "type" of a cholmod_sparse matrix, i.e.

modify it "in place"

Parameters
to_xtyperequested xtype (pattern, real, complex, zomplex)
Asparse matrix to change
Commoncholmod's common
Returns
TRUE/FALSE , TRUE iff success

Definition at line 438 of file chm_common.c.

SEXP chm_sparse_to_SEXP ( CHM_SP  a,
int  dofree,
int  uploT,
int  Rkind,
const char *  diag,
SEXP  dn 
)

Copy the contents of a to an appropriate CsparseMatrix object and, optionally, free a or free both a and its the pointers to its contents.

Parameters
a(cholmod_sparse) matrix to be converted
dofree0 - don't free a; > 0 cholmod_free a; < 0 Free a
uploT0 - not triangular; > 0 upper triangular; < 0 lower
Rkind- vector type to store for a->xtype == CHOLMOD_REAL, 0 - REAL; 1 - LOGICAL [unused for other a->xtype]
diagcharacter string suitable for the diag slot of a triangular matrix (not accessed if uploT == 0).
dneither R_NilValue or an SEXP suitable for the Dimnames slot.
Returns
SEXP containing a copy of a

Definition at line 335 of file chm_common.c.

References _, ALLOC_SLOT(), c, cl, DOFREE_MAYBE, Matrix_diagSym, Matrix_DimNamesSym, Matrix_DimSym, Matrix_iSym, Matrix_pSym, Matrix_uploSym, and Matrix_xSym.

Referenced by CHMfactor_spsolve(), CHMfactor_to_sparse(), Csparse2nz(), Csparse_Csparse_crossprod(), Csparse_Csparse_prod(), Csparse_general_to_symmetric(), Csparse_symmetric_to_general(), Csparse_to_tCsparse(), Csparse_transpose(), dense_to_Csparse(), dsCMatrix_chol(), dsCMatrix_Csparse_solve(), R_init_Matrix(), Tsparse_to_Csparse(), and Tsparse_to_tCsparse().

Here is the call graph for this function:

Here is the caller graph for this function:

void chm_transpose_dense ( CHM_DN  ans,
CHM_DN  x 
)

Transpose a cholmod_dense matrix ("too trivial to be in CHOLMOD?")

Parameters
ans(pointer to) already allocated result of correct dimension
x(pointer to) cholmod_dense matrix to be transposed

Definition at line 754 of file chm_common.c.

References _.

SEXP chm_triplet_to_SEXP ( CHM_TR  a,
int  dofree,
int  uploT,
int  Rkind,
const char *  diag,
SEXP  dn 
)

Copy the contents of a to an appropriate TsparseMatrix object and, optionally, free a or free both a and its the pointers to its contents.

Parameters
amatrix to be converted
dofree0 - don't free a; > 0 cholmod_free a; < 0 Free a
uploT0 - not triangular; > 0 upper triangular; < 0 lower
Rkind- vector type to store for a->xtype == CHOLMOD_REAL, 0 - REAL; 1 - LOGICAL
diagcharacter string suitable for the diag slot of a triangular matrix (not accessed if uploT == 0).
dneither R_NilValue or an SEXP suitable for the Dimnames slot.
Returns
SEXP containing a copy of a

Definition at line 573 of file chm_common.c.

References _, ALLOC_SLOT(), cl, DOFREE_MAYBE, Matrix_diagSym, Matrix_DimNamesSym, Matrix_DimSym, Matrix_iSym, Matrix_jSym, Matrix_uploSym, and Matrix_xSym.

Referenced by Csparse_to_Tsparse(), Csparse_to_tTsparse(), dsCMatrix_to_dgTMatrix(), and R_init_Matrix().

Here is the call graph for this function:

Here is the caller graph for this function:

SEXP CHMfactor_validate ( SEXP  obj)

Definition at line 1259 of file chm_common.c.

SEXP CHMsimpl_validate ( SEXP  obj)

Definition at line 1264 of file chm_common.c.

SEXP CHMsuper_validate ( SEXP  obj)

Definition at line 1269 of file chm_common.c.

static void chTr2Ralloc ( CHM_TR  dest,
CHM_TR  src 
)
static

Copy cholmod_triplet to an R_alloc()ed version of it.

Definition at line 208 of file chm_common.c.

Referenced by as_cholmod_triplet().

Here is the caller graph for this function:

SEXP get_SuiteSparse_version ( )

Definition at line 8 of file chm_common.c.

Rboolean isValid_Csparse ( SEXP  x)

"Cheap" C version of Csparse_validate() - not sorting :

Definition at line 11 of file Csparse.c.

Referenced by as_cholmod_sparse().

Here is the caller graph for this function:

CHM_DN numeric_as_chm_dense ( CHM_DN  ans,
double *  v,
int  nr,
int  nc 
)

Definition at line 1007 of file chm_common.c.

Referenced by R_init_Matrix().

Here is the caller graph for this function:

void R_cholmod_error ( int  status,
const char *  file,
int  line,
const char *  message 
)

Definition at line 769 of file chm_common.c.

References _, and CHM_restore_common().

Referenced by R_cholmod_start().

Here is the call graph for this function:

Here is the caller graph for this function:

static int R_cholmod_printf ( const char *  fmt,
  ... 
)
static

Definition at line 792 of file chm_common.c.

Referenced by R_cholmod_start().

Here is the caller graph for this function:

int R_cholmod_start ( CHM_CM  c)

Initialize the CHOLMOD library and replace the print and error functions by R-specific versions.

Parameters
cpointer to a cholmod_common structure to be initialized
Returns
TRUE if successful

Definition at line 810 of file chm_common.c.

References _, R_cholmod_error(), and R_cholmod_printf().

Referenced by R_init_Matrix().

Here is the call graph for this function:

Here is the caller graph for this function:

static void* RallocedREAL ( SEXP  x)
static

Definition at line 141 of file chm_common.c.

Referenced by as_cholmod_dense(), as_cholmod_x_dense(), and xpt().

Here is the caller graph for this function:

static int stype ( int  ctype,
SEXP  x 
)
static

stype := "symmetry type".

./CHOLMOD/Include/cholmod_core.h says about 'int stype' entry of cholmod_sparse_struct:

0: matrix is "unsymmetric": use both upper and lower triangular parts (the matrix may actually be symmetric in pattern and value, but both parts are explicitly stored and used). May be square or rectangular. >0: matrix is square and symmetric, use upper triangular part. Entries in the lower triangular part are ignored. <0: matrix is square and symmetric, use lower triangular part. Entries in the upper triangular part are ignored.

Definition at line 114 of file chm_common.c.

References uplo_P.

Referenced by as_cholmod_sparse(), and as_cholmod_triplet().

Here is the caller graph for this function:

static void* xpt ( int  ctype,
SEXP  x 
)
static

Definition at line 154 of file chm_common.c.

References Matrix_xSym, and RallocedREAL().

Referenced by as_cholmod_sparse(), as_cholmod_triplet(), and lapack_qr().

Here is the call graph for this function:

Here is the caller graph for this function:

static int xtype ( int  ctype)
static

xtype: the kind of numeric (think "x slot") of Cholmod sparse matrices.

#define CHOLMOD_PATTERN 0 pattern only, no numerical values #define CHOLMOD_REAL 1 a real matrix #define CHOLMOD_COMPLEX 2 a complex matrix (ANSI C99 compatible) #define CHOLMOD_ZOMPLEX 3 a complex matrix (MATLAB compatible)

Definition at line 126 of file chm_common.c.

Referenced by as_cholmod_sparse(), as_cholmod_triplet(), and chm_factor_to_SEXP().

Here is the caller graph for this function:

Variable Documentation

SEXP chm_common_env

Definition at line 18 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP dboundSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP final_asisSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP final_llSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP final_monotonicSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP final_packSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP final_resymbolSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP final_superSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP grow0Sym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP grow1Sym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP grow2Sym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP m0_ordSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP maxrankSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP nmethodsSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP postorderSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP prefer_upperSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP prefer_zomplexSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP quick_return_if_not_posdefSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP supernodal_switchSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().

SEXP supernodalSym
static

Definition at line 19 of file chm_common.c.

Referenced by CHM_restore_common(), CHM_set_common_env(), and CHM_store_common().