Matrix $Rev: 2718 $ at $LastChangedDate: 2011-10-06 11:45:17 +0200 (Thu, 06 Oct 2011) $
Csparse.h File Reference
#include "Mutils.h"
Include dependency graph for Csparse.h:
This graph shows which files directly or indirectly include this file:

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 Documentation

#define DG_I_J (   i,
  j,
  x,
  nnz 
)    create_Csparse("dgCMatrix", i, j, (int*)NULL, 0, (void*)x, nnz, (int*)NULL, R_NilValue, 1)

Definition at line 49 of file Csparse.h.

#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)

Definition at line 51 of file Csparse.h.

#define NG_I_J (   i,
  j,
  nnz 
)    create_Csparse("ngCMatrix", i, j, (int*)NULL, 0, (void*)NULL, nnz, (int*)NULL, R_NilValue, 1)

Definition at line 50 of file Csparse.h.

#define NG_I_P (   i,
  p,
  np,
  nnz 
)    create_Csparse("ngCMatrix", i, (int*)NULL, p, np, (void*)NULL, nnz, (int*)NULL, R_NilValue, 1)

Definition at line 52 of file Csparse.h.


Function Documentation

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.

Parameters:
clsname of actual class of object to create
ioptional integer vector of length nnz of row indices
joptional integer vector of length nnz of column indices
poptional integer vector of length np of row or column pointers
nplength of integer vector p. Must be zero if p == (int*)NULL
xoptional vector of values
nnzlength of vectors i, j and/or x, whichever is to be used
dimsoptional 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.
dimnamesoptional list of length 2 to be used as dimnames
index1indicator of 1-based indices
Returns:
an SEXP of class cls inheriting from CsparseMatrix.

Definition at line 773 of file Csparse.c.

References _, ALLOC_SLOT(), c, Matrix_DimSym, Matrix_iSym, Matrix_pSym, Matrix_xSym, and xtype().

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

SEXP Csparse_diagU2N ( SEXP  x)

Definition at line 534 of file Csparse.c.

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

SEXP Csparse_MatrixMarket ( SEXP  x,
SEXP  fname 
)

Definition at line 633 of file Csparse.c.

References _, AS_CHM_SP, and c.

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

Parameters:
xCsparseMatrix
irow indices (0-origin), or NULL (R's)
jcolumns indices (0-origin), or NULL
Returns:
x[i,j] still CsparseMatrix --- currently, this loses dimnames

Definition at line 591 of file Csparse.c.

References _, AS_CHM_SP, c, chm_sparse_to_SEXP(), and Real_kind.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

SEXP Csparse_validate ( SEXP  x)

Definition at line 36 of file Csparse.c.

References Csparse_validate_().

Here is the call graph for this function:

SEXP Csparse_validate2 ( SEXP  x,
SEXP  maybe_modify 
)

Definition at line 40 of file Csparse.c.

References Csparse_validate_().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

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).

Parameters:
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"
resultKinda (SEXP) string indicating which kind of result is desired.
Returns:
a SEXP, either a (double) number or a length n-vector of diagonal entries

Definition at line 744 of file Csparse.c.

References diag_tC_ptr().

Here is the call graph for this function:

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).

Parameters:
ndimension 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"
resultKinda (SEXP) string indicating which kind of result is desired.
Returns:
a SEXP, either a (double) number or a length n-vector of diagonal entries

Definition at line 660 of file Csparse.c.

References _, and for_DIAG.

Referenced by diag_tC(), and dsCMatrix_LDL_D().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

SEXP nz_pattern_to_Csparse ( SEXP  x,
SEXP  res_kind 
)

Definition at line 180 of file Csparse.c.

References nz2Csparse().

Here is the call graph for this function:

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 
)