Matrix  $Rev: 3071 $ at $LastChangedDate: 2015-03-26 15:35:47 +0100 (Thu, 26 Mar 2015) $
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.

Macros

#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)
 
SEXP Csp_dense_products (SEXP a, SEXP b, Rboolean transp_a, Rboolean transp_b, Rboolean transp_ans)
 
SEXP Csparse2nz (SEXP x, Rboolean tri)
 
SEXP Csparse_band (SEXP x, SEXP k1, SEXP k2)
 
SEXP Csparse_crossprod (SEXP x, SEXP trans, SEXP triplet, SEXP bool_arith)
 
SEXP Csparse_Csparse_crossprod (SEXP a, SEXP b, SEXP trans, SEXP bool_arith)
 [t]crossprod (<Csparse>, <Csparse>) More...
 
SEXP Csparse_Csparse_prod (SEXP a, SEXP b, SEXP bool_arith)
 A %*% B - for matrices of class CsparseMatrix (R package "Matrix") More...
 
SEXP Csparse_dense_crossprod (SEXP a, SEXP b, SEXP transp)
 
SEXP Csparse_dense_prod (SEXP a, SEXP b, SEXP transp)
 
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 sym_dmns)
 
SEXP Csparse_horzcat (SEXP x, SEXP y)
 
SEXP Csparse_MatrixMarket (SEXP x, SEXP fname)
 
SEXP Csparse_sort (SEXP x)
 
SEXP Csparse_submatrix (SEXP x, SEXP i, SEXP j)
 
SEXP Csparse_symmetric_to_general (SEXP x)
 
SEXP Csparse_to_dense (SEXP x, SEXP symm_or_tri)
 From a CsparseMatrix, produce a dense one. More...
 
SEXP Csparse_to_matrix (SEXP x, SEXP chk, SEXP symm)
 
SEXP Csparse_to_nz_pattern (SEXP x, SEXP tri)
 
SEXP Csparse_to_tCsparse (SEXP x, SEXP uplo, SEXP diag)
 
SEXP Csparse_to_Tsparse (SEXP x, SEXP tri)
 
SEXP Csparse_to_tTsparse (SEXP x, SEXP uplo, SEXP diag)
 
SEXP Csparse_to_vector (SEXP x)
 
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 obj, SEXP resultKind)
 
SEXP diag_tC_ptr (int n, int *x_p, double *x_x, Rboolean is_U, int *perm, SEXP resultKind)
 
SEXP iCsparse_subassign (SEXP x, SEXP i_, SEXP j_, SEXP value)
 
Rboolean isValid_Csparse (SEXP x)
 "Cheap" C version of Csparse_validate() - not sorting : More...
 
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)
 

Macro Definition 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 57 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 59 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 58 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 60 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 
)
SEXP Csp_dense_products ( SEXP  a,
SEXP  b,
Rboolean  transp_a,
Rboolean  transp_b,
Rboolean  transp_ans 
)
SEXP Csparse2nz ( SEXP  x,
Rboolean  tri 
)

Definition at line 198 of file Csparse.c.

References AS_CHM_SP__, c, chm_sparse_to_SEXP(), diag_P, Matrix_DimNamesSym, and uplo_P.

Referenced by Csparse_Csparse_crossprod(), and Csparse_to_nz_pattern().

Here is the call graph for this function:

Here is the caller graph for this function:

SEXP Csparse_band ( SEXP  x,
SEXP  k1,
SEXP  k2 
)
SEXP Csparse_crossprod ( SEXP  x,
SEXP  trans,
SEXP  triplet,
SEXP  bool_arith 
)
SEXP Csparse_Csparse_crossprod ( SEXP  a,
SEXP  b,
SEXP  trans,
SEXP  bool_arith 
)

[t]crossprod (<Csparse>, <Csparse>)

Parameters
aa "CsparseMatrix" object
ba "CsparseMatrix" object
transtrans = FALSE: crossprod(a,b) trans = TRUE : tcrossprod(a,b)
bool_arithlogical (TRUE / NA / FALSE): Should boolean arithmetic be used.
Returns
a CsparseMatrix, the (t)cross product of a and b.

Definition at line 520 of file Csparse.c.

References AS_CHM_SP, c, chm_diagN2U(), chm_sparse_to_SEXP(), Csparse2nz(), diag_P, Matrix_DimNamesSym, MATRIX_VALID_tri_Csparse, nz2Csparse(), uplo_P, and x_double.

Here is the call graph for this function:

SEXP Csparse_Csparse_prod ( SEXP  a,
SEXP  b,
SEXP  bool_arith 
)

A %*% B - for matrices of class CsparseMatrix (R package "Matrix")

Parameters
a
b
bool_arith
Returns

NOTA BENE: cholmod_ssmult(A,B, ...) -> ./CHOLMOD/MatrixOps/cholmod_ssmult.c ------— computes a patter*n* matrix __always_ when

*one* of A or B is pattern*n*, because of this (line 73-74):

values = values &&

(A->xtype != CHOLMOD_PATTERN) && (B->xtype != CHOLMOD_PATTERN) ;

==> Often need to copy the patter*n* to a *l*ogical matrix first !!!

Definition at line 446 of file Csparse.c.

References AS_CHM_SP, c, chm_diagN2U(), chm_sparse_to_SEXP(), class_P, diag_P, Matrix_DimNamesSym, MATRIX_VALID_tri_Csparse, nz2Csparse(), uplo_P, and x_double.

Here is the call graph for this function:

SEXP Csparse_dense_crossprod ( SEXP  a,
SEXP  b,
SEXP  transp 
)
SEXP Csparse_dense_prod ( SEXP  a,
SEXP  b,
SEXP  transp 
)
SEXP Csparse_diagN2U ( SEXP  x)
SEXP Csparse_diagU2N ( SEXP  x)

Referenced by R_init_Matrix().

Here is the caller graph for this function:

SEXP Csparse_drop ( SEXP  x,
SEXP  tol 
)
SEXP Csparse_general_to_symmetric ( SEXP  x,
SEXP  uplo,
SEXP  sym_dmns 
)

Definition at line 357 of file Csparse.c.

References _, AS_CHM_SP__, c, chm_sparse_to_SEXP(), equal_string_vectors(), Matrix_DimNamesSym, Matrix_DimSym, Real_kind, and symmetric_DimNames().

Here is the call graph for this function:

SEXP Csparse_horzcat ( SEXP  x,
SEXP  y 
)
SEXP Csparse_MatrixMarket ( SEXP  x,
SEXP  fname 
)
SEXP Csparse_sort ( SEXP  x)

Definition at line 56 of file Csparse.c.

References _.

SEXP Csparse_submatrix ( SEXP  x,
SEXP  i,
SEXP  j 
)
SEXP Csparse_symmetric_to_general ( SEXP  x)

Definition at line 343 of file Csparse.c.

References _, AS_CHM_SP__, c, chm_sparse_to_SEXP(), Matrix_DimNamesSym, Real_kind, and symmetric_DimNames().

Here is the call graph for this function:

SEXP Csparse_to_dense ( SEXP  x,
SEXP  symm_or_tri 
)

From a CsparseMatrix, produce a dense one.

Directly deals with symmetric, triangular and general. Called from ../R/Csparse.R's C2dense()

Parameters
xa CsparseMatrix: currently all 9 of "[dln][gst]CMatrix"
symm_or_triinteger (NA, < 0, > 0, = 0) specifying the knowledge of the caller about x: NA : unknown => will be determined = 0 : "generalMatrix" (not symm or tri); < 0 : "triangularMatrix" > 0 : "symmetricMatrix"
Returns
a "denseMatrix"

Definition at line 121 of file Csparse.c.

References AS_CHM_SP__, c, chm_dense_to_SEXP(), class_P, diag_P, is_sym(), Matrix_DimNamesSym, Matrix_DimSym, Matrix_uploSym, MATRIX_VALID_Csparse, Matrix_xSym, Real_kind, and slot_dup.

Here is the call graph for this function:

SEXP Csparse_to_matrix ( SEXP  x,
SEXP  chk,
SEXP  symm 
)

Definition at line 284 of file Csparse.c.

References AS_CHM_SP2, c, chm_dense_to_matrix(), is_sym(), Matrix_DimNamesSym, MATRIX_VALID_Csparse, and symmetric_DimNames().

Here is the call graph for this function:

SEXP Csparse_to_nz_pattern ( SEXP  x,
SEXP  tri 
)

Definition at line 210 of file Csparse.c.

References _, and Csparse2nz().

Here is the call graph for this function:

SEXP Csparse_to_tCsparse ( SEXP  x,
SEXP  uplo,
SEXP  diag 
)

Definition at line 319 of file Csparse.c.

References AS_CHM_SP__, chm_sparse_to_SEXP(), Matrix_DimNamesSym, and Real_kind.

Here is the call graph for this function:

SEXP Csparse_to_Tsparse ( SEXP  x,
SEXP  tri 
)

Definition at line 305 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_to_tTsparse ( SEXP  x,
SEXP  uplo,
SEXP  diag 
)

Definition at line 330 of file Csparse.c.

References AS_CHM_SP__, c, chm_triplet_to_SEXP(), Matrix_DimNamesSym, and Real_kind.

Here is the call graph for this function:

SEXP Csparse_to_vector ( SEXP  x)

Definition at line 300 of file Csparse.c.

References AS_CHM_SP__, c, and chm_dense_to_vector().

Here is the call graph for this function:

SEXP Csparse_transpose ( SEXP  x,
SEXP  tri 
)

Definition at line 402 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 39 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 51 of file Csparse.c.

References Csparse_validate_().

Here is the call graph for this function:

SEXP Csparse_validate_ ( SEXP  x,
Rboolean  maybe_modify 
)

Referenced by Csparse_validate(), and Csparse_validate2().

Here is the caller graph for this function:

SEXP Csparse_vertcat ( SEXP  x,
SEXP  y 
)
SEXP dCsparse_subassign ( SEXP  x,
SEXP  i_,
SEXP  j_,
SEXP  value 
)
SEXP diag_tC ( SEXP  obj,
SEXP  resultKind 
)
SEXP diag_tC_ptr ( int  n,
int *  x_p,
double *  x_x,
Rboolean  is_U,
int *  perm,
SEXP  resultKind 
)

Referenced by 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 11 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 228 of file Csparse.c.

References _, ALLOC_SLOT(), class_P, Matrix_diagSym, Matrix_DimNamesSym, Matrix_DimSym, Matrix_iSym, Matrix_pSym, Matrix_uploSym, MATRIX_VALID_nCsparse, Matrix_xSym, slot_dup, slot_dup_if_has, x_double, x_integer, and x_logical.

Referenced by Csparse_Csparse_crossprod(), Csparse_Csparse_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 221 of file Csparse.c.

References nz2Csparse().

Here is the call graph for this function:

SEXP Rsparse_validate ( SEXP  x)

Definition at line 62 of file Csparse.c.

References _, Matrix_DimSym, Matrix_jSym, and Matrix_pSym.

SEXP zCsparse_subassign ( SEXP  x,
SEXP  i_,
SEXP  j_,
SEXP  value 
)