12 char op_ct,
int exact,
int checkDN)
14 if (
class[0] !=
'z') {
21 if (
class[1] ==
's') {
34 if (
class[1] ==
't') {
36 if (exact && (nu !=
'N' || op_ct !=
'C'))
40 int *pdim =
DIM(obj), n = pdim[1];
43 if (n == 0 || (n == 1 && op_ct !=
'C'))
55 if (
class[1] ==
'g') {
59 c##TYPE *px = c##PTR(x); \
60 if (c##NAME(test2)(px, (size_t) n, '\0', op_ct, '\0')) \
70 Rcomplex *px = COMPLEX(x), *pu = px, *pl = px;
71 int packed =
class[2] ==
'p';
72 if (
class[1] ==
's') {
77 for (j = 0; j < n; ++j) {
78 for (i = 0; i < j; ++i) {
90 for (j = 0; j < n; ++j) {
96 for (i = j + 1; i < n; ++i) {
106 for (j = 0; j < n; ++j) {
107 for (i = 0; i < j; ++i) {
119 for (j = 0; j < n; ++j) {
125 for (i = j + 1; i < n; ++i) {
139 char op_ct,
int exact,
int checkDN)
141 if (
class[0] !=
'z') {
148 if (
class[1] ==
's') {
161 if (
class[1] ==
't') {
165 if (nu !=
'N' || op_ct !=
'C')
169 int *pdim =
DIM(obj), n = pdim[1];
172 if (n == 0 || (n == 1 && op_ct !=
'C'))
174 if (!exact &&
class[0] !=
'g')
177 if (
class[2] ==
'T') {
184 char cl[] =
"n.TMatrix";
194 int *pp = INTEGER(p_), *pi = INTEGER(i_), i, j, k, kend,
196 if (
class[1] ==
'g') {
198 memcpy(iwork, pp,
sizeof(
int) * (
size_t) n);
204 if (
class[1] ==
'g' && !(exact && op_ct ==
'C')) {
209 SEXP x = GET_SLOT(obj, Matrix_xSym); \
210 c##TYPE *px = c##PTR(x); \
212 for (j = 0, k = 0; j < n; ++j) { \
217 if (iwork[i] == pp[i] || pi[iwork[i]] != j) \
220 if (c##NOT_IDEN(px[k], px[iwork[i]])) \
242 Rcomplex *px = COMPLEX(x);
244 for (j = 0, k = 0; j < n; ++j) {
249 if (iwork[i] == pp[i] || pi[iwork[i]] != j) \
266 else if (
class[1] ==
's')
270 for (j = 0, k = 0; j < n; ++j) {
282 for (j = 0, k = 0; j < n; ++j) {
292 for (j = 0; j < n; ++j)
293 if (iwork[j] != pp[j])
296 ans = (exact) ? 1 : NA_LOGICAL;
306 SEXP s_trans, SEXP s_exact, SEXP s_checkDN)
308 if (
TYPEOF(s_obj) != OBJSXP) {
324 SEXP ans = Rf_ScalarLogical(ans_);
332 SEXP s_trans, SEXP s_exact, SEXP s_checkDN)
344 SEXP ans = Rf_ScalarLogical(ans_);
SEXP sparse_as_Csparse(SEXP, const char *)
#define SWITCH5(c, template)
#define zNOT_ZERO_IMAG(x)
const char * valid_dense[]
#define Matrix_Calloc(p, n, t)
const char * Matrix_class(SEXP, const char **, int, const char *)
#define Matrix_Free(p, n)
#define DIMNAMES(x, mode)
#define GET_SLOT(x, name)
#define VALID_TRANS(s, c)
const char * valid_sparse[]
#define VALID_LOGIC2(s, d)
int DimNames_is_symmetric(SEXP dn)
SEXP matrix_as_dense(SEXP from, const char *zzz, char ul, char ct, char nu, int mg, int new)
SEXP R_sparse_is_symmetric(SEXP s_obj, SEXP s_trans, SEXP s_exact, SEXP s_checkDN)
int dense_is_symmetric(SEXP obj, const char *class, char op_ct, int exact, int checkDN)
int dense_is_diagonal(SEXP, const char *)
SEXP R_dense_is_symmetric(SEXP s_obj, SEXP s_trans, SEXP s_exact, SEXP s_checkDN)
int sparse_is_diagonal(SEXP, const char *)
int sparse_is_symmetric(SEXP obj, const char *class, char op_ct, int exact, int checkDN)