15 SEXP
class = PROTECT(R_do_MAKE_CLASS(what)), obj = R_do_new_object(
class);
32 Rf_error(
_(
"unexpected type \"%s\" in '%s'"),
33 Rf_type2char(type), __func__);
51 Rf_error(
_(
"unexpected kind \"%c\" in '%s'"), kind, __func__);
64 return sizeof(double);
66 return sizeof(Rcomplex);
68 Rf_error(
_(
"unexpected kind \"%c\" in '%s'"), kind, __func__);
75 if (
class[0] ==
'p') {
78 }
else if (
class[1] ==
'o') {
81 case 'r':
return "dsyMatrix";
82 case 'p':
return "dspMatrix";
86 case 'r':
return "dpoMatrix";
87 case 'p':
return "dppMatrix";
89 }
else if (
class[1] ==
'p') {
93 case 'C':
return "zsCMatrix";
94 case 'R':
return "zsRMatrix";
95 case 'T':
return "zsTMatrix";
96 case 'o':
return "zsyMatrix";
97 case 'p':
return "zspMatrix";
101 case 'C':
return "dsCMatrix";
102 case 'R':
return "dsRMatrix";
103 case 'T':
return "dsTMatrix";
104 case 'o':
return "dsyMatrix";
105 case 'p':
return "dspMatrix";
115 int i = R_check_class_etc(x, valid);
127 if (
TYPEOF(obj) != OBJSXP)
143 return (
class[2] ==
'd') ?
'n' :
class[0];
148 if (
TYPEOF(obj) != OBJSXP)
153 return (
class[2] ==
'd') ?
'i' : (
class[3] ==
'M') ?
class[1] :
'g';
158 if (
TYPEOF(obj) != OBJSXP)
188 return Rf_mkString((!
class) ?
"" :
class);
194 return Rf_mkString(s);
199 char s[] = {
Matrix_shape(s_obj, Rf_asInteger(s_mode)),
'\0' };
200 return Rf_mkString(s);
206 return Rf_mkString(s);
#define VALID_MATRIX_OR_VECTOR
#define ERROR_INVALID_CLASS(_X_, _FUNC_)
#define VALID_SPARSE_COMPRESSED
#define VALID_SPARSE_TRIPLET
const char * Matrix_superclass(const char *class, int mode)
const char * valid_sparse_compressed[]
SEXP R_Matrix_shape(SEXP s_obj, SEXP s_mode)
SEXP R_Matrix_repr(SEXP s_obj)
const char * valid_dense[]
const char * valid_matrix[]
const char * Matrix_class(SEXP x, const char **valid, int mode, const char *caller)
SEXP newObject(const char *what)
char Matrix_kind(SEXP obj)
char Matrix_shape(SEXP obj, int mode)
SEXP R_Matrix_class(SEXP s_obj, SEXP s_mode)
size_t kindToSize(char kind)
const char * valid_sparse[]
char Matrix_repr(SEXP obj)
const char * valid_index[]
SEXP R_Matrix_kind(SEXP s_obj)
char typeToKind(SEXPTYPE type)
const char * valid_matrix_or_vector[]
const char * valid_diagonal[]
SEXPTYPE kindToType(char kind)
const char * valid_vector[]
const char * valid_sparse_triplet[]