Matrix r4655
|
Go to the source code of this file.
Macros | |
#define | MKMS(_FORMAT_, ...) mkString(Matrix_sprintf(_FORMAT_, __VA_ARGS__)) |
#define | FREE_THEN(_EXPR_) |
#define | FREE_THEN(_EXPR_) |
#define | FREE_THEN(_EXPR_) |
#define | FREE_THEN(_EXPR_) |
#define | SET_FRAME_FROM_MEMBER(_MEMBER_, _KIND_) |
#define | GET_MEMBER_FROM_FRAME(_MEMBER_, _KIND_) |
Functions | |
SEXP | checkpi (SEXP p, SEXP i, int m, int n) |
cholmod_factor * | sexp_as_cholmod_factor (cholmod_factor *L, SEXP from) |
Coerce from CHMfactor to (cholmod_factor *) | |
cholmod_sparse * | sexp_as_cholmod_sparse (cholmod_sparse *A, SEXP from, Rboolean checkUnit, Rboolean sortInPlace) |
Coerce from CsparseMatrix to (cholmod_sparse *) | |
cholmod_triplet * | sexp_as_cholmod_triplet (cholmod_triplet *A, SEXP from, Rboolean checkUnit) |
Coerce from TsparseMatrix to (cholmod_triplet *) | |
cholmod_dense * | sexp_as_cholmod_dense (cholmod_dense *A, SEXP from) |
Coerce from [nlidz]geMatrix or vector to (cholmod_dense *) | |
cholmod_dense * | numeric_as_cholmod_dense (cholmod_dense *A, double *data, int nrow, int ncol) |
Coerce from (double *) to (cholmod_dense *) with given dimensions. | |
SEXP | cholmod_factor_as_sexp (cholmod_factor *L, int doFree) |
Coerce from (cholmod_factor *) to CHMfactor. | |
SEXP | cholmod_sparse_as_sexp (cholmod_sparse *A, int doFree, int ttype, int doLogic, const char *diagString, SEXP dimnames) |
Coerce from (cholmod_sparse *) to CsparseMatrix. | |
SEXP | cholmod_triplet_as_sexp (cholmod_triplet *A, int doFree, int ttype, int doLogic, const char *diagString, SEXP dimnames) |
Coerce from (cholmod_triplet *) to TsparseMatrix. | |
SEXP | cholmod_dense_as_sexp (cholmod_dense *A, int doFree) |
Coerce from (cholmod_dense *) to [dz]geMatrix. | |
double | cholmod_factor_ldetA (cholmod_factor *L) |
Log determinant from Cholesky factorization. | |
cholmod_factor * | cholmod_factor_update (cholmod_factor *L, cholmod_sparse *A, double beta) |
Update a Cholesky factorization. | |
static void | R_cholmod_error_handler (int status, const char *file, int line, const char *message) |
int | R_cholmod_start (cholmod_common *Common) |
int | R_cholmod_finish (cholmod_common *Common) |
SEXP | R_cholmod_common_envini (SEXP rho) |
void | R_cholmod_common_envset (void) |
void | R_cholmod_common_envget (void) |
Variables | |
SEXP | cholmod_common_env |
static SEXP | dboundSym |
static SEXP | grow0Sym |
static SEXP | grow1Sym |
static SEXP | grow2Sym |
static SEXP | maxrankSym |
static SEXP | supernodal_switchSym |
static SEXP | supernodalSym |
static SEXP | final_asisSym |
static SEXP | final_superSym |
static SEXP | final_llSym |
static SEXP | final_packSym |
static SEXP | final_monotonicSym |
static SEXP | final_resymbolSym |
static SEXP | prefer_zomplexSym |
static SEXP | prefer_upperSym |
static SEXP | quick_return_if_not_posdefSym |
static SEXP | nmethodsSym |
static SEXP | postorderSym |
static SEXP | m0_ordSym |
#define FREE_THEN | ( | _EXPR_ | ) |
#define FREE_THEN | ( | _EXPR_ | ) |
#define FREE_THEN | ( | _EXPR_ | ) |
#define FREE_THEN | ( | _EXPR_ | ) |
#define GET_MEMBER_FROM_FRAME | ( | _MEMBER_, | |
_KIND_ | |||
) |
#define MKMS | ( | _FORMAT_, | |
... | |||
) | mkString(Matrix_sprintf(_FORMAT_, __VA_ARGS__)) |
#define SET_FRAME_FROM_MEMBER | ( | _MEMBER_, | |
_KIND_ | |||
) |
SEXP checkpi | ( | SEXP | p, |
SEXP | i, | ||
int | m, | ||
int | n | ||
) |
Definition at line 5 of file cholmod-common.c.
Referenced by CsparseMatrix_validate_maybe_sorting(), and sexp_as_cholmod_sparse().
SEXP cholmod_dense_as_sexp | ( | cholmod_dense * | A, |
int | doFree | ||
) |
Coerce from (cholmod_dense *) to [dz]geMatrix.
Allocates an S4 object of class [dz]geMatrix and copies into the slots from members of a pointed-to cholmod_dense struct. The specific class of the result is determined by struct member xtype.
A | a pointer to a cholmod_dense struct. |
doFree | a flag indicating if and how to free A before returning. (0) don't free, (>0) free with cholmod_free_dense, (<0) free with R_Free. |
Definition at line 954 of file cholmod-common.c.
References _, FREE_THEN, GET_SLOT, Matrix_DimSym, Matrix_xSym, newObject(), and SET_SLOT.
Referenced by R_init_Matrix().
SEXP cholmod_factor_as_sexp | ( | cholmod_factor * | L, |
int | doFree | ||
) |
Coerce from (cholmod_factor *) to CHMfactor.
Allocates an S4 object inheriting from virtual class CHMfactor and copies into the slots from members of a pointed-to cholmod_factor struct. The specific class of the result is determined by struct members xtype and is_super.
L | a pointer to a cholmod_factor struct. |
doFree | a flag indicating if and how to free L before returning. (0) don't free, (>0) free with cholmod_free_factor, (<0) free with R_Free. |
Definition at line 584 of file cholmod-common.c.
References _, FREE_THEN, GET_SLOT, Matrix_DimSym, Matrix_iSym, Matrix_permSym, Matrix_pSym, Matrix_xSym, newObject(), and SET_SLOT.
Referenced by R_init_Matrix().
double cholmod_factor_ldetA | ( | cholmod_factor * | L | ) |
Log determinant from Cholesky factorization.
Computes log(det(A)) given the Cholesky factorization of A as P1 * A * P1' = L1 * D * L1' = L * L', L = L1 * sqrt(D). The result is computed as sum(log(diag(D))) or 2*sum(log(diag(L))), depending on members is_super and is_ll of the supplied struct. Note that CHOLMOD does not require diag(D) to be positive and that this routine does not check (FIXME).
L | a pointer to a cholmod_factor struct. It is assumed that L->xtype=CHOLMOD_REAL. |
Definition at line 1017 of file cholmod-common.c.
References _.
Referenced by R_init_Matrix().
cholmod_factor * cholmod_factor_update | ( | cholmod_factor * | L, |
cholmod_sparse * | A, | ||
double | beta | ||
) |
Update a Cholesky factorization.
Updates in-place the Cholesky factorization of a symmetric matrix X+alpha*I with the Cholesky factorization of (1) A+beta*I, where A is a symmetric matrix sharing the nonzero pattern of X, or (2) A*A'+beta*I, where A is a general matrix sharing the nonzero pattern of Y, assuming that X = Y*Y'.
L | a pointer to a cholmod_factor struct, to be modified in-place. |
A | a pointer to a cholmod_sparse struct. |
beta | a multiplier, typically positive, to guarantee strict diagonal dominance. |
Definition at line 1064 of file cholmod-common.c.
Referenced by R_init_Matrix().
SEXP cholmod_sparse_as_sexp | ( | cholmod_sparse * | A, |
int | doFree, | ||
int | ttype, | ||
int | doLogic, | ||
const char * | diagString, | ||
SEXP | dimnames | ||
) |
Coerce from (cholmod_sparse *) to CsparseMatrix.
Allocates an S4 object inheriting from virtual class CsparseMatrix and copies into the slots from members of a pointed-to cholmod_sparse struct. The specific class of the result is determined by struct members xtype and stype and by arguments ttype and doLogic.
A | a pointer to a cholmod_sparse struct. |
doFree | a flag indicating if and how to free A before returning. (0) don't free, (>0) free with cholmod_free_sparse, (<0) free with R_Free. |
ttype | a flag indicating if the result should be a .tCMatrix. (0) not .tCMatrix, (>0) .tCMatrix with uplo="U", (<0) .tCMatrix with uplo="L". If ttype=0, then the result is a .gCMatrix or .sCMatrix depending on stype. (0) .gCMatrix, (>0) .sCMatrix with uplo="U", (<0) .sCMatrix with uplo="L". |
doLogic | a flag indicating if the result should be a l.CMatrix if xtype=CHOLMOD_REAL. |
diagString | a null-terminated string or NULL. The diag slot of a .tCMatrix result is "N" if and only if diagString is NULL or diagString[0] is 'N'. |
dimnames | an R object specifying the Dimnames slot of the result, unused if not a list of length 2. |
Definition at line 732 of file cholmod-common.c.
References _, c, FREE_THEN, GET_SLOT, Matrix_diagSym, Matrix_DimNamesSym, Matrix_DimSym, Matrix_iSym, Matrix_pSym, Matrix_uploSym, Matrix_xSym, newObject(), and SET_SLOT.
Referenced by R_init_Matrix().
SEXP cholmod_triplet_as_sexp | ( | cholmod_triplet * | A, |
int | doFree, | ||
int | ttype, | ||
int | doLogic, | ||
const char * | diagString, | ||
SEXP | dimnames | ||
) |
Coerce from (cholmod_triplet *) to TsparseMatrix.
Allocates an S4 object inheriting from virtual class TsparseMatrix and copies into the slots from members of a pointed-to cholmod_triplet struct. The specific class of the result is determined by struct members xtype and stype and by arguments ttype and doLogic.
A | a pointer to a cholmod_triplet struct. |
doFree | a flag indicating if and how to free A before returning. (0) don't free, (>0) free with cholmod_free_triplet, (<0) free with R_Free. |
ttype | a flag indicating if the result should be a .tTMatrix. (0) not .tTMatrix, (>0) .tTMatrix with uplo="U", (<0) .tTMatrix with uplo="L". If ttype=0, then the result is a .gTMatrix or .sTMatrix depending on stype. (0) .gTMatrix, (>0) .sTMatrix with uplo="U", (<0) .sTMatrix with uplo="L". |
doLogic | a flag indicating if the result should be an l.TMatrix if xtype=CHOLMOD_REAL. |
diagString | a null-terminated string or NULL. The diag slot of a .tTMatrix result is "N" if and only if diagString is NULL or diagString[0] is 'N'. |
dimnames | an R object specifying the Dimnames slot of the result, unused if not a list of length 2. |
Definition at line 848 of file cholmod-common.c.
References _, FREE_THEN, GET_SLOT, Matrix_diagSym, Matrix_DimNamesSym, Matrix_DimSym, Matrix_iSym, Matrix_jSym, Matrix_uploSym, Matrix_xSym, newObject(), and SET_SLOT.
Referenced by R_init_Matrix().
cholmod_dense * numeric_as_cholmod_dense | ( | cholmod_dense * | A, |
double * | data, | ||
int | nrow, | ||
int | ncol | ||
) |
Coerce from (double *) to (cholmod_dense *) with given dimensions.
An analogue of base::matrix(data, nrow, ncol), where typeof(data)=="double" and length(data)==nrow*ncol.
A | a pointer to a cholmod_dense struct, to be modified in-place. |
data | a pointer to an nrow*ncol*sizeof(double) block of memory. |
nrow | the desired number of rows. |
ncol | the desired number of columns. |
Definition at line 554 of file cholmod-common.c.
Referenced by R_init_Matrix().
void R_cholmod_common_envget | ( | void | ) |
Definition at line 1217 of file cholmod-common.c.
References c, cholmod_common_env, GET_MEMBER_FROM_FRAME, and m0_ordSym.
Referenced by dpCMatrix_trf_(), and R_cholmod_error_handler().
SEXP R_cholmod_common_envini | ( | SEXP | rho | ) |
Definition at line 1154 of file cholmod-common.c.
References cholmod_common_env, dboundSym, ERROR_INVALID_TYPE, final_asisSym, final_llSym, final_monotonicSym, final_packSym, final_resymbolSym, final_superSym, grow0Sym, grow1Sym, grow2Sym, m0_ordSym, maxrankSym, nmethodsSym, postorderSym, prefer_upperSym, prefer_zomplexSym, quick_return_if_not_posdefSym, R_cholmod_common_envset(), supernodal_switchSym, and supernodalSym.
void R_cholmod_common_envset | ( | void | ) |
Definition at line 1181 of file cholmod-common.c.
References c, cholmod_common_env, m0_ordSym, and SET_FRAME_FROM_MEMBER.
Referenced by dpCMatrix_trf_(), and R_cholmod_common_envini().
|
static |
Definition at line 1092 of file cholmod-common.c.
References _, and R_cholmod_common_envget().
Referenced by R_cholmod_start().
int R_cholmod_finish | ( | cholmod_common * | Common | ) |
int R_cholmod_start | ( | cholmod_common * | Common | ) |
Definition at line 1104 of file cholmod-common.c.
References _, and R_cholmod_error_handler().
Referenced by R_init_Matrix().
cholmod_dense * sexp_as_cholmod_dense | ( | cholmod_dense * | A, |
SEXP | from | ||
) |
Coerce from [nlidz]geMatrix or vector to (cholmod_dense *)
Sets the members of a pointed-to cholmod_dense struct, using "data" obtained from slots of a [nlidz]geMatrix. The result should not be freed using cholmod_free_dense, as the resulting members point to memory controlled by R, not by CHOLMOD.
A | a pointer to a cholmod_dense struct, to be modified in-place. |
from | an S4 object inheriting from class [nlidz]geMatrix or a traditional vector of type "logical", "integer", "double", or "complex" (to be handled as a 1-column matrix if not a matrix). |
Definition at line 470 of file cholmod-common.c.
References ERROR_INVALID_TYPE, GET_SLOT, Matrix_DimSym, Matrix_xSym, and valid.
Referenced by R_init_Matrix().
cholmod_factor * sexp_as_cholmod_factor | ( | cholmod_factor * | L, |
SEXP | from | ||
) |
Coerce from CHMfactor to (cholmod_factor *)
Sets the members of a pointed-to cholmod_factor struct, using "data" obtained from slots of a CHMfactor. The result should not be freed using cholmod_free_factor, as the resulting members point to memory controlled by R, not by CHOLMOD.
L | a pointer to a cholmod_factor struct, to be modified in-place. |
from | an S4 object inheriting from virtual class CHMfactor. |
Definition at line 80 of file cholmod-common.c.
References _, c, ERROR_INVALID_CLASS, ERROR_INVALID_TYPE, GET_SLOT, Matrix_DimSym, Matrix_iSym, Matrix_permSym, Matrix_pSym, Matrix_xSym, and valid.
Referenced by R_init_Matrix().
cholmod_sparse * sexp_as_cholmod_sparse | ( | cholmod_sparse * | A, |
SEXP | from, | ||
Rboolean | checkUnit, | ||
Rboolean | sortInPlace | ||
) |
Coerce from CsparseMatrix to (cholmod_sparse *)
Sets the members of a pointed-to cholmod_sparse struct, using "data" obtained from slots of a CsparseMatrix. The result should not be freed using cholmod_free_sparse, as the resulting members point to memory controlled by R, not by CHOLMOD.
A | a pointer to a cholmod_sparse struct, to be modified in-place. |
from | an S4 object inheriting from virtual class CsparseMatrix. |
checkUnit | a boolean indicating if the unit diagonal of formally unit triangular CsparseMatrix should be allocated. |
sortInPlace | a boolean indicating if unsorted CsparseMatrix should be sorted in place to avoid an allocation. |
Definition at line 188 of file cholmod-common.c.
References _, c, checkpi(), ERROR_INVALID_CLASS, GET_SLOT, Matrix_diagSym, Matrix_DimSym, Matrix_iSym, Matrix_pSym, Matrix_uploSym, Matrix_xSym, and valid.
Referenced by R_init_Matrix().
cholmod_triplet * sexp_as_cholmod_triplet | ( | cholmod_triplet * | A, |
SEXP | from, | ||
Rboolean | checkUnit | ||
) |
Coerce from TsparseMatrix to (cholmod_triplet *)
Sets the members of a pointed-to cholmod_triplet struct, using "data" obtained from slots of a TsparseMatrix. The result should not be freed using cholmod_free_sparse, as the resulting members point to memory controlled by R, not by CHOLMOD.
A | a pointer to a cholmod_triplet struct, to be modified in-place. |
from | an S4 object inheriting from virtual class TsparseMatrix. |
checkUnit | a boolean indicating if the unit diagonal of formally unit triangular TsparseMatrix should be allocated. |
Definition at line 340 of file cholmod-common.c.
References ERROR_INVALID_CLASS, GET_SLOT, Matrix_diagSym, Matrix_DimSym, Matrix_iSym, Matrix_pSym, Matrix_uploSym, Matrix_xSym, Matrix_zone, and valid.
Referenced by R_init_Matrix().
SEXP cholmod_common_env |
Definition at line 1130 of file cholmod-common.c.
Referenced by R_cholmod_common_envget(), R_cholmod_common_envini(), and R_cholmod_common_envset().
|
static |
Definition at line 1134 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1141 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1143 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1145 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1144 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1146 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1142 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1135 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1136 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1137 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1152 of file cholmod-common.c.
Referenced by R_cholmod_common_envget(), R_cholmod_common_envini(), and R_cholmod_common_envset().
|
static |
Definition at line 1138 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1150 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1151 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1148 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1147 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1149 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1139 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().
|
static |
Definition at line 1140 of file cholmod-common.c.
Referenced by R_cholmod_common_envini().