|
Matrix $Rev: 2718 $ at $LastChangedDate: 2011-10-06 11:45:17 +0200 (Thu, 06 Oct 2011) $
|
#include "Mutils.h"

Go to the source code of this file.
Defines | |
| #define | DG_I_J(i, j, x, nnz) create_Csparse("dgCMatrix", i, j, (int*)NULL, 0, (void*)x, nnz, (int*)NULL, R_NilValue, 1) |
| #define | DG_I_P(i, p, np, x, nnz) create_Csparse("dgCMatrix", i, (int*)NULL, p, np, (void*)x, nnz, (int*)NULL, R_NilValue, 1) |
| #define | NG_I_J(i, j, nnz) create_Csparse("ngCMatrix", i, j, (int*)NULL, 0, (void*)NULL, nnz, (int*)NULL, R_NilValue, 1) |
| #define | NG_I_P(i, p, np, nnz) create_Csparse("ngCMatrix", i, (int*)NULL, p, np, (void*)NULL, nnz, (int*)NULL, R_NilValue, 1) |
Functions | |
| SEXP | create_Csparse (char *cls, int *i, int *j, int *p, int np, void *x, int nnz, int *dims, SEXP dimnames, int index1) |
| Create a Csparse matrix object from indices and/or pointers. | |
| SEXP | Csparse_band (SEXP x, SEXP k1, SEXP k2) |
| SEXP | Csparse_crossprod (SEXP x, SEXP trans, SEXP triplet) |
| SEXP | Csparse_Csparse_crossprod (SEXP a, SEXP b, SEXP trans) |
| SEXP | Csparse_Csparse_prod (SEXP a, SEXP b) |
| SEXP | Csparse_dense_crossprod (SEXP a, SEXP b) |
| SEXP | Csparse_dense_prod (SEXP a, SEXP b) |
| SEXP | Csparse_diagN2U (SEXP x) |
| SEXP | Csparse_diagU2N (SEXP x) |
| SEXP | Csparse_drop (SEXP x, SEXP tol) |
| SEXP | Csparse_general_to_symmetric (SEXP x, SEXP uplo) |
| SEXP | Csparse_horzcat (SEXP x, SEXP y) |
| SEXP | Csparse_MatrixMarket (SEXP x, SEXP fname) |
| SEXP | Csparse_submatrix (SEXP x, SEXP i, SEXP j) |
| "Indexing" aka subsetting : Compute x[i,j], also for vectors i and j Working via CHOLMOD_submatrix, see . | |
| SEXP | Csparse_symmetric_to_general (SEXP x) |
| SEXP | Csparse_to_dense (SEXP x) |
| SEXP | Csparse_to_matrix (SEXP x) |
| SEXP | Csparse_to_nz_pattern (SEXP x, SEXP tri) |
| SEXP | Csparse_to_Tsparse (SEXP x, SEXP tri) |
| SEXP | Csparse_transpose (SEXP x, SEXP tri) |
| SEXP | Csparse_validate (SEXP x) |
| SEXP | Csparse_validate2 (SEXP x, SEXP maybe_modify) |
| SEXP | Csparse_validate_ (SEXP x, Rboolean maybe_modify) |
| SEXP | Csparse_vertcat (SEXP x, SEXP y) |
| SEXP | dCsparse_subassign (SEXP x, SEXP i_, SEXP j_, SEXP value) |
| SEXP | diag_tC (SEXP pslot, SEXP xslot, SEXP perm_slot, SEXP resultKind) |
| Extract the diagonal entries from *triangular* Csparse matrix __or__ a cholmod_sparse factor (LDL = TRUE). | |
| SEXP | diag_tC_ptr (int n, int *x_p, double *x_x, int *perm, SEXP resultKind) |
| Extract the diagonal entries from *triangular* Csparse matrix __or__ a cholmod_sparse factor (LDL = TRUE). | |
| SEXP | iCsparse_subassign (SEXP x, SEXP i_, SEXP j_, SEXP value) |
| Rboolean | isValid_Csparse (SEXP x) |
| "Cheap" C version of Csparse_validate() - *not* sorting : | |
| SEXP | lCsparse_subassign (SEXP x, SEXP i_, SEXP j_, SEXP value) |
| SEXP | nCsparse_subassign (SEXP x, SEXP i_, SEXP j_, SEXP value) |
| SEXP | nz2Csparse (SEXP x, enum x_slot_kind r_kind) |
| SEXP | nz_pattern_to_Csparse (SEXP x, SEXP res_kind) |
| SEXP | Rsparse_validate (SEXP x) |
| SEXP | zCsparse_subassign (SEXP x, SEXP i_, SEXP j_, SEXP value) |
| #define DG_I_J | ( | i, | |
| j, | |||
| x, | |||
| nnz | |||
| ) | create_Csparse("dgCMatrix", i, j, (int*)NULL, 0, (void*)x, nnz, (int*)NULL, R_NilValue, 1) |
| #define DG_I_P | ( | i, | |
| p, | |||
| np, | |||
| x, | |||
| nnz | |||
| ) | create_Csparse("dgCMatrix", i, (int*)NULL, p, np, (void*)x, nnz, (int*)NULL, R_NilValue, 1) |
| #define NG_I_J | ( | i, | |
| j, | |||
| nnz | |||
| ) | create_Csparse("ngCMatrix", i, j, (int*)NULL, 0, (void*)NULL, nnz, (int*)NULL, R_NilValue, 1) |
| #define NG_I_P | ( | i, | |
| p, | |||
| np, | |||
| nnz | |||
| ) | create_Csparse("ngCMatrix", i, (int*)NULL, p, np, (void*)NULL, nnz, (int*)NULL, R_NilValue, 1) |
| SEXP create_Csparse | ( | char * | cls, |
| int * | i, | ||
| int * | j, | ||
| int * | p, | ||
| int | np, | ||
| void * | x, | ||
| int | nnz, | ||
| int * | dims, | ||
| SEXP | dimnames, | ||
| int | index1 | ||
| ) |
Create a Csparse matrix object from indices and/or pointers.
| cls | name of actual class of object to create |
| i | optional integer vector of length nnz of row indices |
| j | optional integer vector of length nnz of column indices |
| p | optional integer vector of length np of row or column pointers |
| np | length of integer vector p. Must be zero if p == (int*)NULL |
| x | optional vector of values |
| nnz | length of vectors i, j and/or x, whichever is to be used |
| dims | optional integer vector of length 2 to be used as dimensions. If dims == (int*)NULL then the maximum row and column index are used as the dimensions. |
| dimnames | optional list of length 2 to be used as dimnames |
| index1 | indicator of 1-based indices |
Definition at line 773 of file Csparse.c.
References _, ALLOC_SLOT(), c, Matrix_DimSym, Matrix_iSym, Matrix_pSym, Matrix_xSym, and xtype().

| SEXP Csparse_band | ( | SEXP | x, |
| SEXP | k1, | ||
| SEXP | k2 | ||
| ) |
Definition at line 523 of file Csparse.c.
References AS_CHM_SP__, c, chm_sparse_to_SEXP(), Matrix_DimNamesSym, and Real_kind.

| SEXP Csparse_crossprod | ( | SEXP | x, |
| SEXP | trans, | ||
| SEXP | triplet | ||
| ) |
Definition at line 437 of file Csparse.c.
References _, AS_CHM_SP, AS_CHM_TR, AS_CHM_TR__, c, chm_sparse_to_SEXP(), Matrix_DimNamesSym, and Tsparse_diagU2N().

| SEXP Csparse_Csparse_crossprod | ( | SEXP | a, |
| SEXP | b, | ||
| SEXP | trans | ||
| ) |
Definition at line 343 of file Csparse.c.
References AS_CHM_SP, c, chm_diagN2U(), chm_sparse_to_SEXP(), class_P, diag_P, Matrix_DimNamesSym, and uplo_P.

| SEXP Csparse_Csparse_prod | ( | SEXP | a, |
| SEXP | b | ||
| ) |
Definition at line 300 of file Csparse.c.
References AS_CHM_SP, c, chm_diagN2U(), chm_sparse_to_SEXP(), class_P, diag_P, Matrix_DimNamesSym, and uplo_P.

| SEXP Csparse_dense_crossprod | ( | SEXP | a, |
| SEXP | b | ||
| ) |
Definition at line 411 of file Csparse.c.
References AS_CHM_DN, AS_CHM_SP, c, chm_dense_to_SEXP(), Matrix_DimNamesSym, mMatrix_as_dgeMatrix(), nz2Csparse(), and x_double.

| SEXP Csparse_dense_prod | ( | SEXP | a, |
| SEXP | b | ||
| ) |
Definition at line 380 of file Csparse.c.
References AS_CHM_DN, AS_CHM_SP, c, chm_dense_to_SEXP(), Matrix_DimNamesSym, mMatrix_as_dgeMatrix(), nz2Csparse(), and x_double.

| SEXP Csparse_diagN2U | ( | SEXP | x | ) |
Definition at line 558 of file Csparse.c.
References AS_CHM_SP__, chm_diagN2U(), chm_sparse_to_SEXP(), cl, class_P, diag_P, Matrix_DimNamesSym, Real_kind, and uplo_P.

| SEXP Csparse_drop | ( | SEXP | x, |
| SEXP | tol | ||
| ) |
Definition at line 478 of file Csparse.c.
References _, AS_CHM_SP__, c, chm_sparse_to_SEXP(), cl, class_P, diag_P, Matrix_DimNamesSym, Real_kind, and uplo_P.

| SEXP Csparse_general_to_symmetric | ( | SEXP | x, |
| SEXP | uplo | ||
| ) |
Definition at line 267 of file Csparse.c.
References AS_CHM_SP__, c, chm_sparse_to_SEXP(), Matrix_DimNamesSym, and Real_kind.

| SEXP Csparse_horzcat | ( | SEXP | x, |
| SEXP | y | ||
| ) |
Definition at line 497 of file Csparse.c.
References AS_CHM_SP__, c, chm_sparse_to_SEXP(), and Real_kind.

| SEXP Csparse_MatrixMarket | ( | SEXP | x, |
| SEXP | fname | ||
| ) |
| SEXP Csparse_submatrix | ( | SEXP | x, |
| SEXP | i, | ||
| SEXP | j | ||
| ) |
"Indexing" aka subsetting : Compute x[i,j], also for vectors i and j Working via CHOLMOD_submatrix, see .
/CHOLMOD/MatrixOps/cholmod_submatrix.c
| x | CsparseMatrix |
| i | row indices (0-origin), or NULL (R's) |
| j | columns indices (0-origin), or NULL |
Definition at line 591 of file Csparse.c.
References _, AS_CHM_SP, c, chm_sparse_to_SEXP(), and Real_kind.

| SEXP Csparse_symmetric_to_general | ( | SEXP | x | ) |
Definition at line 253 of file Csparse.c.
References _, AS_CHM_SP__, c, chm_sparse_to_SEXP(), Matrix_DimNamesSym, and Real_kind.

| SEXP Csparse_to_dense | ( | SEXP | x | ) |
Definition at line 152 of file Csparse.c.
References AS_CHM_SP__, c, chm_dense_to_SEXP(), Matrix_DimNamesSym, and Real_kind.

| SEXP Csparse_to_matrix | ( | SEXP | x | ) |
Definition at line 232 of file Csparse.c.
References AS_CHM_SP__, c, chm_dense_to_matrix(), and Matrix_DimNamesSym.

| SEXP Csparse_to_nz_pattern | ( | SEXP | x, |
| SEXP | tri | ||
| ) |
Definition at line 166 of file Csparse.c.
References AS_CHM_SP__, c, chm_sparse_to_SEXP(), diag_P, Matrix_DimNamesSym, and uplo_P.

| SEXP Csparse_to_Tsparse | ( | SEXP | x, |
| SEXP | tri | ||
| ) |
Definition at line 238 of file Csparse.c.
References AS_CHM_SP__, c, chm_triplet_to_SEXP(), diag_P, Matrix_DimNamesSym, Real_kind, and uplo_P.

| SEXP Csparse_transpose | ( | SEXP | x, |
| SEXP | tri | ||
| ) |
Definition at line 280 of file Csparse.c.
References AS_CHM_SP__, c, chm_sparse_to_SEXP(), diag_P, Matrix_DimNamesSym, Real_kind, and uplo_P.
Referenced by R_to_CMatrix().


| SEXP Csparse_validate | ( | SEXP | x | ) |
Definition at line 36 of file Csparse.c.
References Csparse_validate_().

| SEXP Csparse_validate2 | ( | SEXP | x, |
| SEXP | maybe_modify | ||
| ) |
Definition at line 40 of file Csparse.c.
References Csparse_validate_().

| SEXP Csparse_validate_ | ( | SEXP | x, |
| Rboolean | maybe_modify | ||
| ) |
Definition at line 44 of file Csparse.c.
References _, as_cholmod_sparse(), Matrix_DimSym, Matrix_iSym, and Matrix_pSym.
Referenced by Csparse_validate(), and Csparse_validate2().


| SEXP Csparse_vertcat | ( | SEXP | x, |
| SEXP | y | ||
| ) |
Definition at line 510 of file Csparse.c.
References AS_CHM_SP__, c, chm_sparse_to_SEXP(), and Real_kind.

| SEXP dCsparse_subassign | ( | SEXP | x, |
| SEXP | i_, | ||
| SEXP | j_, | ||
| SEXP | value | ||
| ) |
| SEXP diag_tC | ( | SEXP | pslot, |
| SEXP | xslot, | ||
| SEXP | perm_slot, | ||
| SEXP | resultKind | ||
| ) |
Extract the diagonal entries from *triangular* Csparse matrix __or__ a cholmod_sparse factor (LDL = TRUE).
| pslot | 'p' (column pointer) slot of Csparse matrix/factor |
| xslot | 'x' (non-zero entries) slot of Csparse matrix/factor |
| perm_slot | 'perm' (= permutation vector) slot of corresponding CHMfactor; only used for "diagBack" |
| resultKind | a (SEXP) string indicating which kind of result is desired. |
Definition at line 744 of file Csparse.c.
References diag_tC_ptr().

| SEXP diag_tC_ptr | ( | int | n, |
| int * | x_p, | ||
| double * | x_x, | ||
| int * | perm, | ||
| SEXP | resultKind | ||
| ) |
Extract the diagonal entries from *triangular* Csparse matrix __or__ a cholmod_sparse factor (LDL = TRUE).
| n | dimension of the matrix. |
| x_p | 'p' (column pointer) slot contents |
| x_x | 'x' (non-zero entries) slot contents |
| perm | 'perm' (= permutation vector) slot contents; only used for "diagBack" |
| resultKind | a (SEXP) string indicating which kind of result is desired. |
Definition at line 660 of file Csparse.c.
Referenced by diag_tC(), and dsCMatrix_LDL_D().

| SEXP iCsparse_subassign | ( | SEXP | x, |
| SEXP | i_, | ||
| SEXP | j_, | ||
| SEXP | value | ||
| ) |
| Rboolean isValid_Csparse | ( | SEXP | x | ) |
"Cheap" C version of Csparse_validate() - *not* sorting :
Definition at line 8 of file Csparse.c.
References Matrix_DimSym, Matrix_iSym, and Matrix_pSym.
| SEXP lCsparse_subassign | ( | SEXP | x, |
| SEXP | i_, | ||
| SEXP | j_, | ||
| SEXP | value | ||
| ) |
| SEXP nCsparse_subassign | ( | SEXP | x, |
| SEXP | i_, | ||
| SEXP | j_, | ||
| SEXP | value | ||
| ) |
| SEXP nz2Csparse | ( | SEXP | x, |
| enum x_slot_kind | r_kind | ||
| ) |
Definition at line 185 of file Csparse.c.
References _, ALLOC_SLOT(), class_P, Matrix_diagSym, Matrix_DimNamesSym, Matrix_DimSym, Matrix_iSym, Matrix_pSym, Matrix_uploSym, Matrix_xSym, slot_dup, slot_dup_if_has, x_double, x_integer, and x_logical.
Referenced by Csparse_dense_crossprod(), Csparse_dense_prod(), and nz_pattern_to_Csparse().


| SEXP nz_pattern_to_Csparse | ( | SEXP | x, |
| SEXP | res_kind | ||
| ) |
Definition at line 180 of file Csparse.c.
References nz2Csparse().

| SEXP Rsparse_validate | ( | SEXP | x | ) |
Definition at line 103 of file Csparse.c.
References _, Matrix_DimSym, Matrix_jSym, and Matrix_pSym.
| SEXP zCsparse_subassign | ( | SEXP | x, |
| SEXP | i_, | ||
| SEXP | j_, | ||
| SEXP | value | ||
| ) |