Matrix r5059
Loading...
Searching...
No Matches
coerce.c File Reference
#include "Mdefines.h"
#include "M5.h"
#include "idz.h"
#include "coerce.h"

Go to the source code of this file.

Macros

#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE__(d)
 
#define TEMPLATE__(d, c0, c1)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define DAS_CHECK
 
#define DAS_BYCOL(c, kernel, hook)
 
#define DAS_BYROW(c, kernel, hook)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE__(d, c)
 
#define TEMPLATE(c)
 
#define TEMPLATE__(d, c)
 
#define TEMPLATE__(d, c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE__(d, c)
 

Functions

SEXP vector_as_dense (SEXP from, const char *zzz, char ul, char ct, char nu, int m, int n, int byrow, SEXP dimnames)
 
SEXP R_vector_as_dense (SEXP s_from, SEXP s_zzz, SEXP s_uplo, SEXP s_trans, SEXP s_diag, SEXP s_m, SEXP s_n, SEXP s_byrow, SEXP s_dimnames)
 
SEXP matrix_as_dense (SEXP from, const char *zzz, char ul, char ct, char nu, int mg, int new)
 
SEXP R_matrix_as_dense (SEXP s_from, SEXP s_zzz, SEXP s_uplo, SEXP s_trans, SEXP s_diag, SEXP s_margin)
 
SEXP sparse_as_dense (SEXP from, const char *class, int packed)
 
SEXP R_sparse_as_dense (SEXP s_from, SEXP s_packed)
 
SEXP diagonal_as_dense (SEXP from, const char *class, char kind, char shape, int packed, char ul, char ct)
 
SEXP R_diagonal_as_dense (SEXP s_from, SEXP s_kind, SEXP s_shape, SEXP s_packed, SEXP s_uplo, SEXP s_trans)
 
SEXP index_as_dense (SEXP from, const char *class, char kind)
 
SEXP R_index_as_dense (SEXP s_from, SEXP s_kind)
 
SEXP Vector_as_sparse (SEXP from, const char *zzz, char ul, char ct, char nu, int m, int n, int byrow, SEXP dimnames)
 
SEXP R_Vector_as_sparse (SEXP s_from, SEXP s_zzz, SEXP s_uplo, SEXP s_trans, SEXP s_diag, SEXP s_m, SEXP s_n, SEXP s_byrow, SEXP s_dimnames)
 
SEXP matrix_as_sparse (SEXP from, const char *zzz, char ul, char ct, char nu, int mg)
 
SEXP R_matrix_as_sparse (SEXP s_from, SEXP s_zzz, SEXP s_uplo, SEXP s_trans, SEXP s_diag, SEXP s_margin)
 
SEXP dense_as_sparse (SEXP from, const char *class, char repr)
 
SEXP R_dense_as_sparse (SEXP s_from, SEXP s_repr)
 
SEXP diagonal_as_sparse (SEXP from, const char *class, char kind, char shape, char repr, char ul, char ct)
 
SEXP R_diagonal_as_sparse (SEXP s_from, SEXP s_kind, SEXP s_shape, SEXP s_repr, SEXP s_uplo, SEXP s_trans)
 
SEXP index_as_sparse (SEXP from, const char *class, char kind, char repr)
 
SEXP R_index_as_sparse (SEXP s_from, SEXP s_kind, SEXP s_repr)
 
SEXP dense_as_kind (SEXP from, const char *class, char kind, int new)
 
SEXP R_dense_as_kind (SEXP s_from, SEXP s_kind)
 
SEXP sparse_as_kind (SEXP from, const char *class, char kind)
 
SEXP R_sparse_as_kind (SEXP s_from, SEXP s_kind)
 
SEXP diagonal_as_kind (SEXP from, const char *class, char kind)
 
SEXP R_diagonal_as_kind (SEXP s_from, SEXP s_kind)
 
SEXP index_as_kind (SEXP from, const char *class, char kind)
 
SEXP R_index_as_kind (SEXP s_from, SEXP s_kind)
 
SEXP dense_as_general (SEXP from, const char *class, int new)
 
SEXP R_dense_as_general (SEXP s_from)
 
SEXP sparse_as_general (SEXP from, const char *class)
 
SEXP R_sparse_as_general (SEXP s_from)
 
SEXP dense_as_unpacked (SEXP from, const char *class)
 
SEXP R_dense_as_unpacked (SEXP s_from)
 
SEXP dense_as_packed (SEXP from, const char *class, char ul, char ct, char nu)
 
SEXP R_dense_as_packed (SEXP s_from, SEXP s_uplo, SEXP s_trans, SEXP s_diag)
 
SEXP sparse_as_Csparse (SEXP from, const char *class)
 
SEXP R_sparse_as_Csparse (SEXP s_from)
 
SEXP sparse_as_Rsparse (SEXP from, const char *class)
 
SEXP R_sparse_as_Rsparse (SEXP s_from)
 
SEXP sparse_as_Tsparse (SEXP from, const char *class)
 
SEXP R_sparse_as_Tsparse (SEXP s_from)
 
SEXP vector_as_Vector (SEXP from, char kind)
 
SEXP R_vector_as_Vector (SEXP s_from, SEXP s_kind)
 
SEXP sparse_as_Vector (SEXP from, const char *class)
 
SEXP R_sparse_as_Vector (SEXP s_from)
 
SEXP diagonal_as_Vector (SEXP from, const char *class)
 
SEXP R_diagonal_as_Vector (SEXP s_from)
 
SEXP index_as_Vector (SEXP from, const char *class)
 
SEXP R_index_as_Vector (SEXP s_from)
 
SEXP R_Matrix_as_vector (SEXP s_from)
 
SEXP R_Matrix_as_matrix (SEXP s_from)
 
SEXP R_Matrix_as_unpacked (SEXP s_from)
 
SEXP R_Matrix_as_packed (SEXP s_from)
 
SEXP R_Matrix_as_Csparse (SEXP s_from)
 
SEXP R_Matrix_as_Rsparse (SEXP s_from)
 
SEXP R_Matrix_as_Tsparse (SEXP s_from)
 
SEXP R_Matrix_as_Vector (SEXP s_from)
 
SEXP R_Matrix_as_kind (SEXP s_from, SEXP s_kind, SEXP s_sparse)
 
SEXP R_Matrix_as_general (SEXP s_from, SEXP s_kind)
 

Macro Definition Documentation

◆ DAS_BYCOL

#define DAS_BYCOL ( c,
kernel,
hook )

◆ DAS_BYROW

#define DAS_BYROW ( c,
kernel,
hook )

◆ DAS_CHECK

#define DAS_CHECK
Value:
do { \
if (nnz > INT_MAX) \
Rf_error(_("attempt to construct %s with more than %s nonzero entries"), \
"sparseMatrix", "2^31-1"); \
*(pp1++) = (int) nnz; \
} while (0)
#define _(String)
Definition Mdefines.h:66

◆ TEMPLATE [1/27]

◆ TEMPLATE [2/27]

#define TEMPLATE ( c)
Value:
c##NAME(pack2)(c##PTR(x), c##PTR(from), (size_t) n, \
ul, '\0', 'N')
cholmod_common c
Definition cholmod-etc.c:5

◆ TEMPLATE [3/27]

#define TEMPLATE ( c)

◆ TEMPLATE [4/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = c##PTR(x0), *px1 = c##PTR(x1); \
if (!packed) \
c##NAME(force2)(px1, px0, (size_t) n, ul, 1, -nu); \
else \
c##NAME(force1)(px1, px0, (size_t) n, ul, 1, -nu); \
} while (0)

◆ TEMPLATE [5/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px = c##PTR(x); \
memset(px, 0, sizeof(c##TYPE) * (size_t) xlen); \
if (mg == 0) { \
int_fast64_t m1 = (int_fast64_t) m; \
for (int i = 0; i < m; ++i) { \
px[m1 * (*(pperm++) - 1)] = c##UNIT; \
px += 1; \
} \
} else { \
for (int j = 0; j < n; ++j) { \
px[ *(pperm++) - 1 ] = c##UNIT; \
px += m; \
} \
} \
} while (0)

◆ TEMPLATE [6/27]

#define TEMPLATE ( c)
Value:
do { \
if (TYPEOF(i0) == INTSXP) \
TEMPLATE__(i, n, c); \
else \
TEMPLATE__(d, n, c); \
} while (0)
#define TYPEOF(s)
Definition Mdefines.h:123

◆ TEMPLATE [7/27]

#define TEMPLATE ( c)
Value:
do { \
if (TYPEOF(i0) == INTSXP) \
TEMPLATE__(i, c, c); \
else \
TEMPLATE__(d, c, c); \
} while (0)

◆ TEMPLATE [8/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = c##PTR(x0); \
switch (cl[2]) { \
case 'C': \
DAS_BYCOL(c, ++nnz, DAS_CHECK); \
break; \
case 'R': \
DAS_BYROW(c, ++nnz, DAS_CHECK); \
break; \
case 'T': \
DAS_BYCOL(c, ++nnz, ); \
break; \
default: \
break; \
} \
} while (0)
cholmod_common cl
Definition cholmod-etc.c:6
#define DAS_CHECK

◆ TEMPLATE [9/27]

#define TEMPLATE ( c)

◆ TEMPLATE [10/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = c##PTR(x0); \
for (j = 0; j < n; ++j) { \
if ((ct == 'C') ? c##NOT_ZERO_REAL(*px0) : c##NOT_ZERO(*px0)) \
++nnz; \
px0 += 1; \
} \
} while (0)

◆ TEMPLATE [11/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = c##PTR(x0); \
for (j = 0; j < n; ++j) { \
if ((ct == 'C') ? c##NOT_ZERO_REAL(*px0) : c##NOT_ZERO(*px0)) \
++nnz; \
px0 += 1; \
*(pp1++) = nnz; \
} \
} while (0)

◆ TEMPLATE [12/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = c##PTR(x0); \
c##IF_NPATTERN( \
SEXP x1 = PROTECT(Rf_allocVector(c##TYPESXP, nnz)); \
c##TYPE *px1 = c##PTR(x1); \
); \
for (j = 0; j < n; ++j) { \
if ((ct == 'C') ? c##NOT_ZERO_REAL(*px0) : c##NOT_ZERO(*px0)) { \
*(pi1++) = j; \
c##IF_NPATTERN( \
*(px1++) = *px0; \
); \
} \
px0 += 1; \
} \
c##IF_NPATTERN( \
SET_SLOT(to, Matrix_xSym, x1); \
UNPROTECT(1); /* x1 */ \
); \
} while (0)
#define SET_SLOT(x, name, value)
Definition Mdefines.h:73
SEXP Matrix_xSym
Definition init.c:635

◆ TEMPLATE [13/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = c##PTR(x0), *px1 = c##PTR(x1); \
if (packed) \
c##NAME( pack1)(px1, px0, (size_t) n, ul, ct, nu); \
else if (new) \
c##NAME(force2)(px1, px0, (size_t) n, ul, ct, nu); \
else \
c##NAME(force2)(px1, NULL, (size_t) n, ul, ct, nu); \
} while (0)

◆ TEMPLATE [14/27]

#define TEMPLATE ( c)

◆ TEMPLATE [15/27]

#define TEMPLATE ( c)

◆ TEMPLATE [16/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = c##PTR(x0), *px1 = c##PTR(x1); \
c##NAME(pack1)(px1, px0, (size_t) n, ul, '\0', 'N'); \
} while (0)

◆ TEMPLATE [17/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = c##PTR(x0), *px1 = c##PTR(x1); \
c##NAME(pack2)(px1, px0, (size_t) n, ul, '\0', 'N'); \
} while (0)

◆ TEMPLATE [18/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = NULL, *px1 = NULL; \
c##IF_NPATTERN( \
SEXP x0 = PROTECT(GET_SLOT(from, Matrix_xSym)), \
x1 = PROTECT(Rf_allocVector(c##TYPESXP, INTEGER(p0)[m])); \
px0 = c##PTR(x0); \
px1 = c##PTR(x1); \
SET_SLOT(to, Matrix_xSym, x1); \
UNPROTECT(2); /* x1, x0 */ \
); \
c##csptrans(pp1, pi1, px1, pp0, pj0, px0, n, m, 'T', iwork); \
} while (0)
#define GET_SLOT(x, name)
Definition Mdefines.h:72

◆ TEMPLATE [19/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = NULL, *px1 = NULL, *work = NULL; \
c##IF_NPATTERN( \
SEXP x0 = PROTECT(GET_SLOT(from, Matrix_xSym)); \
px0 = c##PTR(x0); \
Matrix_Calloc(work, lwork, c##TYPE); \
); \
c##tspsort(pp1, pi1, px1, pi0, pj0, px0, m, n, &nnz, iwork, work); \
PROTECT(p1 = Rf_allocVector(INTSXP, (R_xlen_t) n + 1)), \
PROTECT(i1 = Rf_allocVector(INTSXP, nnz)); \
pp1 = INTEGER(p1); \
pi1 = INTEGER(i1); \
SET_SLOT(to, Matrix_pSym, p1); \
SET_SLOT(to, Matrix_iSym, i1); \
c##IF_NPATTERN( \
SEXP x1 = PROTECT(Rf_allocVector(c##TYPESXP, nnz)); \
px1 = c##PTR(x1); \
SET_SLOT(to, Matrix_xSym, x1); \
); \
c##tspsort(pp1, pi1, px1, pi0, pj0, px0, m, n, &nnz, iwork, work); \
c##IF_NPATTERN( \
UNPROTECT(1); /* x1 */ \
); \
UNPROTECT(2); /* i1, p1 */ \
c##IF_NPATTERN( \
Matrix_Free(work, lwork); \
UNPROTECT(1); /* x0 */ \
); \
} while (0)
#define Matrix_Free(p, n)
Definition Mdefines.h:56
SEXP Matrix_iSym
Definition init.c:607
SEXP Matrix_pSym
Definition init.c:622

◆ TEMPLATE [20/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = NULL, *px1 = NULL; \
c##IF_NPATTERN( \
SEXP x0 = PROTECT(GET_SLOT(from, Matrix_xSym)), \
x1 = PROTECT(Rf_allocVector(c##TYPESXP, INTEGER(p0)[n])); \
px0 = c##PTR(x0); \
px1 = c##PTR(x1); \
SET_SLOT(to, Matrix_xSym, x1); \
UNPROTECT(2); /* x1, x0 */ \
); \
c##csptrans(pp1, pj1, px1, pp0, pi0, px0, m, n, 'T', iwork); \
} while (0)

◆ TEMPLATE [21/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = NULL, *px1 = NULL, *work = NULL; \
c##IF_NPATTERN( \
SEXP x0 = PROTECT(GET_SLOT(from, Matrix_xSym)); \
px0 = c##PTR(x0); \
Matrix_Calloc(work, nnz, c##TYPE); \
); \
c##tspsort(pp1, pj1, px1, pj0, pi0, px0, n, m, &nnz, iwork, work); \
PROTECT(p1 = Rf_allocVector(INTSXP, (R_xlen_t) m + 1)), \
PROTECT(j1 = Rf_allocVector(INTSXP, nnz)); \
pp1 = INTEGER(p1); \
pj1 = INTEGER(j1); \
SET_SLOT(to, Matrix_pSym, p1); \
SET_SLOT(to, Matrix_jSym, j1); \
c##IF_NPATTERN( \
SEXP x1 = PROTECT(Rf_allocVector(c##TYPESXP, nnz)); \
px1 = c##PTR(x1); \
SET_SLOT(to, Matrix_xSym, x1); \
); \
c##tspsort(pp1, pj1, px1, pj0, pi0, px0, n, m, &nnz, iwork, work); \
c##IF_NPATTERN( \
UNPROTECT(1); /* x1 */ \
); \
UNPROTECT(2); /* j1, p1 */ \
c##IF_NPATTERN( \
Matrix_Free(work, lwork); \
UNPROTECT(1); /* x0 */ \
); \
} while (0)
SEXP Matrix_jSym
Definition init.c:610

◆ TEMPLATE [22/27]

#define TEMPLATE ( c)
Value:
memcpy(c##PTR(x1), c##PTR(x0), sizeof(c##TYPE) * (size_t) nnz)

◆ TEMPLATE [23/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = c##PTR(x0); \
for (k = 0; k < vlen; ++k) \
if (c##NOT_ZERO(px0[k])) \
++nnz; \
} while (0)

◆ TEMPLATE [24/27]

#define TEMPLATE ( c)
Value:
do { \
if (TYPEOF(i1) == INTSXP) \
TEMPLATE__(i, c); \
else \
TEMPLATE__(d, c); \
} while (0)

◆ TEMPLATE [25/27]

#define TEMPLATE ( c)
Value:
do { \
if (TYPEOF(i1) == INTSXP) \
TEMPLATE__(i, c); \
else \
TEMPLATE__(d, c); \
} while (0)

◆ TEMPLATE [26/27]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px0 = c##PTR(x0); \
for (j = 0; j < n; ++j) \
if (c##NOT_ZERO(px0[j])) \
++nnz1; \
} while (0)

◆ TEMPLATE [27/27]

#define TEMPLATE ( c)
Value:
do { \
if (TYPEOF(i1) == INTSXP) \
TEMPLATE__(i, c); \
else \
TEMPLATE__(d, c); \
} while (0)

◆ TEMPLATE__ [1/6]

#define TEMPLATE__ ( d)

Referenced by Vector_as_sparse().

◆ TEMPLATE__ [2/6]

#define TEMPLATE__ ( d,
c )
Value:
do { \
d##TYPE *pi1 = d##PTR(i1); \
c##TYPE *px0 = c##PTR(x0); \
c##IF_NPATTERN( \
SEXP x1 = PROTECT(Rf_allocVector(c##TYPESXP, nnz)); \
c##TYPE *px1 = c##PTR(x1); \
); \
for (k = 0; k < vlen; ++k) \
if (c##NOT_ZERO(px0[k])) { \
*(pi1++) = (d##TYPE) (k + 1); \
c##IF_NPATTERN( \
*(px1++) = px0[k]; \
); \
} \
c##IF_NPATTERN( \
PROTECT(x1 = Rf_coerceVector(x1, tt)); \
SET_SLOT(to, Matrix_xSym, x1); \
UNPROTECT(2); /* x1 */ \
); \
} while (0)

◆ TEMPLATE__ [3/6]

#define TEMPLATE__ ( d,
c )
Value:
do { \
d##TYPE *pi1 = d##PTR(i1), l = (d##TYPE) 1, dl = (d##TYPE) m; \
c##IF_NPATTERN( \
SEXP x0 = PROTECT(GET_SLOT(from, Matrix_xSym)), \
x1 = PROTECT(Rf_allocVector(c##TYPESXP, nnz)); \
c##TYPE *px0 = c##PTR(x0), *px1 = c##PTR(x1); \
SET_SLOT(to, Matrix_xSym, x1); \
UNPROTECT(2); /* x1, x0 */ \
); \
for (j = 0, k = 0; j < n; ++j) { \
kend = pp0[j]; \
while (k < kend) { \
c##IF_NPATTERN( \
*(px1++) = px0[k]; \
); \
*(pi1++) = pi0[k] + l; \
++k; \
} \
l += dl; \
} \
} while (0)

◆ TEMPLATE__ [4/6]

#define TEMPLATE__ ( d,
c )
Value:
do { \
d##TYPE *pi1 = d##PTR(i1); \
c##IF_NPATTERN( \
SEXP x0 = PROTECT(GET_SLOT(from, Matrix_xSym)), \
x1 = PROTECT(Rf_allocVector(c##TYPESXP, nnz)); \
c##TYPE *px0 = c##PTR(x0), *px1 = c##PTR(x1); \
SET_SLOT(to, Matrix_xSym, x1); \
UNPROTECT(2); /* x1, x0 */ \
); \
for (i = 0, k = 0; i < m; ++i) { \
kend = pp0[i]; \
while (k < kend) { \
j = pj0[k]; \
c##IF_NPATTERN( \
px1[iwork[j] ] = px0[k]; \
); \
pi1[iwork[j]++] = i + 1 + j * (d##TYPE) m; \
++k; \
} \
} \
} while (0)

◆ TEMPLATE__ [5/6]

#define TEMPLATE__ ( d,
c )
Value:
do { \
d##TYPE *pi1 = d##PTR(i1), l = (d##TYPE) 1, dl = (d##TYPE) (n + 1); \
c##TYPE *px0 = c##PTR(x0); \
c##IF_NPATTERN( \
SEXP x1 = PROTECT(Rf_allocVector(c##TYPESXP, nnz1)); \
c##TYPE *px1 = c##PTR(x1); \
SET_SLOT(to, Matrix_xSym, x1); \
UNPROTECT(1); /* x1 */ \
); \
for (j = 0; j < n; ++j) { \
if (nu != 'N' || c##NOT_ZERO(px0[j])) { \
*(pi1++) = l; \
c##IF_NPATTERN( \
*(px1++) = (nu != 'N') ? c##UNIT : px0[j]; \
); \
} \
l += dl; \
} \
} while (0)

◆ TEMPLATE__ [6/6]

#define TEMPLATE__ ( d,
c0,
c1 )

Function Documentation

◆ dense_as_general()

◆ dense_as_kind()

◆ dense_as_packed()

SEXP dense_as_packed ( SEXP from,
const char * class,
char ul,
char ct,
char nu )

◆ dense_as_sparse()

◆ dense_as_unpacked()

SEXP dense_as_unpacked ( SEXP from,
const char * class )

◆ diagonal_as_dense()

SEXP diagonal_as_dense ( SEXP from,
const char * class,
char kind,
char shape,
int packed,
char ul,
char ct )

◆ diagonal_as_kind()

SEXP diagonal_as_kind ( SEXP from,
const char * class,
char kind )

◆ diagonal_as_sparse()

◆ diagonal_as_Vector()

SEXP diagonal_as_Vector ( SEXP from,
const char * class )

◆ index_as_dense()

SEXP index_as_dense ( SEXP from,
const char * class,
char kind )

◆ index_as_kind()

SEXP index_as_kind ( SEXP from,
const char * class,
char kind )

Definition at line 2221 of file coerce.c.

References index_as_sparse().

Referenced by R_index_as_kind().

◆ index_as_sparse()

◆ index_as_Vector()

SEXP index_as_Vector ( SEXP from,
const char * class )

◆ matrix_as_dense()

SEXP matrix_as_dense ( SEXP from,
const char * zzz,
char ul,
char ct,
char nu,
int mg,
int new )

◆ matrix_as_sparse()

SEXP matrix_as_sparse ( SEXP from,
const char * zzz,
char ul,
char ct,
char nu,
int mg )

Definition at line 1295 of file coerce.c.

References cl, dense_as_sparse(), matrix_as_dense(), sparse_as_kind(), TYPEOF, and typeToKind().

Referenced by coerceArgs(), and R_matrix_as_sparse().

◆ R_dense_as_general()

SEXP R_dense_as_general ( SEXP s_from)

Definition at line 2292 of file coerce.c.

References dense_as_general(), Matrix_class(), and valid_dense.

◆ R_dense_as_kind()

SEXP R_dense_as_kind ( SEXP s_from,
SEXP s_kind )

Definition at line 2066 of file coerce.c.

References dense_as_kind(), Matrix_class(), valid_dense, and VALID_KIND.

◆ R_dense_as_packed()

SEXP R_dense_as_packed ( SEXP s_from,
SEXP s_uplo,
SEXP s_trans,
SEXP s_diag )

Definition at line 2717 of file coerce.c.

References dense_as_packed(), Matrix_class(), valid_dense, VALID_DIAG, VALID_TRANS, and VALID_UPLO.

◆ R_dense_as_sparse()

SEXP R_dense_as_sparse ( SEXP s_from,
SEXP s_repr )

Definition at line 1735 of file coerce.c.

References dense_as_sparse(), Matrix_class(), valid_dense, and VALID_REPR.

◆ R_dense_as_unpacked()

SEXP R_dense_as_unpacked ( SEXP s_from)

Definition at line 2648 of file coerce.c.

References dense_as_unpacked(), Matrix_class(), and valid_dense.

◆ R_diagonal_as_dense()

SEXP R_diagonal_as_dense ( SEXP s_from,
SEXP s_kind,
SEXP s_shape,
SEXP s_packed,
SEXP s_uplo,
SEXP s_trans )

◆ R_diagonal_as_kind()

SEXP R_diagonal_as_kind ( SEXP s_from,
SEXP s_kind )

Definition at line 2211 of file coerce.c.

References diagonal_as_kind(), Matrix_class(), valid_diagonal, and VALID_KIND.

◆ R_diagonal_as_sparse()

SEXP R_diagonal_as_sparse ( SEXP s_from,
SEXP s_kind,
SEXP s_shape,
SEXP s_repr,
SEXP s_uplo,
SEXP s_trans )

◆ R_diagonal_as_Vector()

SEXP R_diagonal_as_Vector ( SEXP s_from)

Definition at line 3368 of file coerce.c.

References diagonal_as_Vector(), Matrix_class(), and valid_diagonal.

◆ R_index_as_dense()

SEXP R_index_as_dense ( SEXP s_from,
SEXP s_kind )

Definition at line 740 of file coerce.c.

References index_as_dense(), Matrix_class(), valid_index, and VALID_KIND.

◆ R_index_as_kind()

SEXP R_index_as_kind ( SEXP s_from,
SEXP s_kind )

Definition at line 2227 of file coerce.c.

References index_as_kind(), Matrix_class(), valid_index, and VALID_KIND.

◆ R_index_as_sparse()

SEXP R_index_as_sparse ( SEXP s_from,
SEXP s_kind,
SEXP s_repr )

Definition at line 1989 of file coerce.c.

References index_as_sparse(), Matrix_class(), valid_index, VALID_KIND, and VALID_REPR.

◆ R_index_as_Vector()

SEXP R_index_as_Vector ( SEXP s_from)

Definition at line 3440 of file coerce.c.

References index_as_Vector(), Matrix_class(), and valid_index.

◆ R_Matrix_as_Csparse()

SEXP R_Matrix_as_Csparse ( SEXP s_from)

◆ R_matrix_as_dense()

SEXP R_matrix_as_dense ( SEXP s_from,
SEXP s_zzz,
SEXP s_uplo,
SEXP s_trans,
SEXP s_diag,
SEXP s_margin )

◆ R_Matrix_as_general()

SEXP R_Matrix_as_general ( SEXP s_from,
SEXP s_kind )

◆ R_Matrix_as_kind()

◆ R_Matrix_as_matrix()

◆ R_Matrix_as_packed()

SEXP R_Matrix_as_packed ( SEXP s_from)

◆ R_Matrix_as_Rsparse()

SEXP R_Matrix_as_Rsparse ( SEXP s_from)

◆ R_matrix_as_sparse()

SEXP R_matrix_as_sparse ( SEXP s_from,
SEXP s_zzz,
SEXP s_uplo,
SEXP s_trans,
SEXP s_diag,
SEXP s_margin )

◆ R_Matrix_as_Tsparse()

SEXP R_Matrix_as_Tsparse ( SEXP s_from)

◆ R_Matrix_as_unpacked()

SEXP R_Matrix_as_unpacked ( SEXP s_from)

◆ R_Matrix_as_Vector()

SEXP R_Matrix_as_Vector ( SEXP s_from)

◆ R_Matrix_as_vector()

SEXP R_Matrix_as_vector ( SEXP s_from)

◆ R_sparse_as_Csparse()

SEXP R_sparse_as_Csparse ( SEXP s_from)

Definition at line 2841 of file coerce.c.

References Matrix_class(), sparse_as_Csparse(), and valid_sparse.

◆ R_sparse_as_dense()

SEXP R_sparse_as_dense ( SEXP s_from,
SEXP s_packed )

Definition at line 589 of file coerce.c.

References Matrix_class(), sparse_as_dense(), VALID_LOGIC2, and valid_sparse.

◆ R_sparse_as_general()

SEXP R_sparse_as_general ( SEXP s_from)

Definition at line 2592 of file coerce.c.

References Matrix_class(), sparse_as_general(), and valid_sparse.

◆ R_sparse_as_kind()

SEXP R_sparse_as_kind ( SEXP s_from,
SEXP s_kind )

Definition at line 2150 of file coerce.c.

References Matrix_class(), sparse_as_kind(), VALID_KIND, and valid_sparse.

◆ R_sparse_as_Rsparse()

SEXP R_sparse_as_Rsparse ( SEXP s_from)

Definition at line 2957 of file coerce.c.

References Matrix_class(), sparse_as_Rsparse(), and valid_sparse.

◆ R_sparse_as_Tsparse()

SEXP R_sparse_as_Tsparse ( SEXP s_from)

Definition at line 3038 of file coerce.c.

References Matrix_class(), sparse_as_Tsparse(), and valid_sparse.

◆ R_sparse_as_Vector()

SEXP R_sparse_as_Vector ( SEXP s_from)

Definition at line 3275 of file coerce.c.

References Matrix_class(), sparse_as_Vector(), and valid_sparse.

◆ R_vector_as_dense()

SEXP R_vector_as_dense ( SEXP s_from,
SEXP s_zzz,
SEXP s_uplo,
SEXP s_trans,
SEXP s_diag,
SEXP s_m,
SEXP s_n,
SEXP s_byrow,
SEXP s_dimnames )

◆ R_Vector_as_sparse()

SEXP R_Vector_as_sparse ( SEXP s_from,
SEXP s_zzz,
SEXP s_uplo,
SEXP s_trans,
SEXP s_diag,
SEXP s_m,
SEXP s_n,
SEXP s_byrow,
SEXP s_dimnames )

◆ R_vector_as_Vector()

SEXP R_vector_as_Vector ( SEXP s_from,
SEXP s_kind )

Definition at line 3124 of file coerce.c.

References ERROR_INVALID_TYPE, TYPEOF, VALID_KIND, and vector_as_Vector().

◆ sparse_as_Csparse()

◆ sparse_as_dense()

◆ sparse_as_general()

◆ sparse_as_kind()

◆ sparse_as_Rsparse()

◆ sparse_as_Tsparse()

◆ sparse_as_Vector()

SEXP sparse_as_Vector ( SEXP from,
const char * class )

◆ vector_as_dense()

SEXP vector_as_dense ( SEXP from,
const char * zzz,
char ul,
char ct,
char nu,
int m,
int n,
int byrow,
SEXP dimnames )

◆ Vector_as_sparse()

SEXP Vector_as_sparse ( SEXP from,
const char * zzz,
char ul,
char ct,
char nu,
int m,
int n,
int byrow,
SEXP dimnames )

◆ vector_as_Vector()

SEXP vector_as_Vector ( SEXP from,
char kind )