Matrix  $Rev: 3071 $ at $LastChangedDate: 2015-03-26 15:35:47 +0100 (Thu, 26 Mar 2015) $
Csparse.c File Reference

The "CsparseMatrix" class from R package Matrix: More...

#include "Csparse.h"
#include "Tsparse.h"
#include "chm_common.h"
#include "t_Csparse_validate.c"
Include dependency graph for Csparse.c:

Go to the source code of this file.

Macros

#define _t_Csparse_sort
 
#define _t_Csparse_validate
 

Functions

SEXP Csparse2nz (SEXP x, Rboolean tri)
 
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_general_to_symmetric (SEXP x, SEXP uplo, SEXP sym_dmns)
 
SEXP Csparse_sort (SEXP x)
 
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)
 
Rboolean isValid_Csparse (SEXP x)
 "Cheap" C version of Csparse_validate() - not sorting : More...
 
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)
 

Detailed Description

The "CsparseMatrix" class from R package Matrix:

Sparse matrices in compressed column-oriented form

Definition in file Csparse.c.

Macro Definition Documentation

#define _t_Csparse_sort

Definition at line 47 of file Csparse.c.

#define _t_Csparse_validate

Definition at line 44 of file Csparse.c.

Function Documentation

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_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_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_sort ( SEXP  x)

Definition at line 56 of file Csparse.c.

References _.

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:

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.

Referenced by as_cholmod_sparse().

Here is the caller graph for this function:

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.