13 if (
class[1] ==
't') {
15 if (op_ul ==
'\0' || op_ul == ul)
16 return ( ul ==
'U') ? 1 : -1;
18 return (op_ul ==
'U') ? 1 : -1;
23 if (
class[1] ==
's') {
26 else if (op_ul !=
'\0')
27 return (op_ul ==
'U') ? 1 : -1;
30 return ( ul ==
'U') ? 1 : -1;
34 int *pdim =
DIM(obj), n = pdim[1];
38 return (op_ul ==
'\0' || op_ul ==
'U') ? 1 : -1;
44 c##TYPE *px = c##PTR(x); \
45 if ((op_ul == '\0' || op_ul == 'U') && \
46 !c##NAME(test2)(px, (size_t) n, 'U', '\0', 'N')) \
48 if ((op_ul == '\0' || op_ul != 'U') && \
49 !c##NAME(test2)(px, (size_t) n, 'L', '\0', 'N')) \
62 if (
class[1] ==
't') {
64 if (op_ul ==
'\0' || op_ul == ul)
65 return ( ul ==
'U') ? 1 : -1;
67 return (op_ul ==
'U') ? 1 : -1;
72 if (
class[1] ==
's') {
75 else if (op_ul !=
'\0')
76 return (op_ul ==
'U') ? 1 : -1;
79 return ( ul ==
'U') ? 1 : -1;
83 int *pdim =
DIM(obj), n = pdim[1];
87 return ((op_ul ==
'\0') ?
class[2] !=
'R' : op_ul ==
'U') ? 1 : -1;
89 if (
class[2] !=
'T') {
94 int *pp = INTEGER(p), *pi = INTEGER(i), j, k, kend;
100 for (j = 0, k = 0; j < n; ++j) { \
102 if (k < kend && pi[kend - 1] > j) \
112 for (j = 0, k = 0; j < n; ++j) { \
114 if (k < kend && pi[k] < j) \
122 if (op_ul ==
'\0' || op_ul ==
'U') {
128 if (op_ul ==
'\0' || op_ul !=
'U') {
142 int *pi = INTEGER(i), *pj = INTEGER(j);
143 R_xlen_t k, kend = XLENGTH(i);
146 if (op_ul ==
'\0' || op_ul ==
'U') {
147 for (k = 0; k < kend; ++k)
153 if (op_ul ==
'\0' || op_ul !=
'U') {
154 for (k = 0; k < kend; ++k)
168 if (
TYPEOF(s_obj) != OBJSXP) {
180 (up == NA_LOGICAL) ?
'\0' : ((up != 0) ?
'U' :
'L'));
181 SEXP ans = Rf_allocVector(LGLSXP, 1);
182 LOGICAL(ans)[0] = ans_ != 0;
183 if (up == NA_LOGICAL && ans_ != 0) {
186 PROTECT(kind = Rf_mkString((ans_ > 0) ?
"U" :
"L"));
203 (up == NA_LOGICAL) ?
'\0' : ((up != 0) ?
'U' :
'L'));
204 SEXP ans = Rf_allocVector(LGLSXP, 1);
205 LOGICAL(ans)[0] = ans_ != 0;
206 if (up == NA_LOGICAL && ans_ != 0) {
209 PROTECT(kind = Rf_mkString((ans_ > 0) ?
"U" :
"L"));
#define SWITCH4(c, template)
#define VALID_LOGIC3(s, d)
const char * valid_dense[]
const char * Matrix_class(SEXP, const char **, int, const char *)
#define GET_SLOT(x, name)
const char * valid_sparse[]
SEXP matrix_as_dense(SEXP from, const char *zzz, char ul, char ct, char nu, int mg, int new)
int dense_is_diagonal(SEXP, const char *)
SEXP R_sparse_is_triangular(SEXP s_obj, SEXP s_upper)
int dense_is_triangular(SEXP obj, const char *class, char op_ul)
SEXP R_dense_is_triangular(SEXP s_obj, SEXP s_upper)
int sparse_is_diagonal(SEXP, const char *)
int sparse_is_triangular(SEXP obj, const char *class, char op_ul)