14 if (
class[1] ==
's' &&
class[0] ==
'z')
18 int strict = ISNAN(tol) || tol <= 0.0;
20#define NZ(c, x) ((strict) ? c##NOT_ZERO(x) : c##NOT_ZERO_TOL(x, tol))
22 if (
class[2] !=
'T') {
28 int *pp0 = INTEGER(p0), *pi0 = INTEGER(i0),
29 n = (int) (XLENGTH(p0) - 1), j, k, kend,
30 nnz0 = pp0[n], nnz1 = 0;
37 c##TYPE *px0 = c##PTR(x0); \
38 for (k = 0; k < nnz0; ++k) \
49 Rcomplex *px0 = COMPLEX(x0);
50 for (j = 0, k = 0; j < n; ++j) {
53 if ((pi0[k] == j) ?
NZ(d, px0[k].r) :
NZ(z, px0[k]))
68 SEXP p1 = PROTECT(Rf_allocVector(INTSXP, XLENGTH(p0))),
69 i1 = PROTECT(Rf_allocVector(INTSXP, nnz1)),
70 x1 = PROTECT(Rf_allocVector(
TYPEOF(x0), nnz1));
71 int *pp1 = INTEGER(p1), *pi1 = INTEGER(i1);
81 c##TYPE *px0 = c##PTR(x0), *px1 = c##PTR(x1); \
82 for (j = 0, k = 0; j < n; ++j) { \
83 pp1[j] = pp1[j - 1]; \
86 if (NZ(c, px0[k])) { \
87 pi1[pp1[j] ] = pi0[k]; \
88 px1[pp1[j]++] = px0[k]; \
101 Rcomplex *px0 = COMPLEX(x0), *px1 = COMPLEX(x1);
102 for (j = 0, k = 0; j < n; ++j) {
106 if ((pi0[k] == j) ?
NZ(d, px0[k].r) :
NZ(z, px0[k])) {
107 pi1[pp1[j] ] = pi0[k];
108 px1[pp1[j]++] = px0[k];
123 int *pi0 = INTEGER(i0), *pj0 = INTEGER(j0);
124 R_xlen_t k, nnz0 = XLENGTH(x0), nnz1 = 0;
130 c##TYPE *px0 = c##PTR(x0); \
131 for (k = 0; k < nnz0; ++k) \
142 Rcomplex *px0 = COMPLEX(x0);
143 for (k = 0; k < nnz0; ++k)
144 if ((pi0[k] == pj0[k]) ?
NZ(d, px0[k].r) :
NZ(z, px0[k]))
156 SEXP i1 = PROTECT(Rf_allocVector(INTSXP, nnz1)),
157 j1 = PROTECT(Rf_allocVector(INTSXP, nnz1)),
158 x1 = PROTECT(Rf_allocVector(
TYPEOF(x0), nnz1));
159 int *pi1 = INTEGER(i1), *pj1 = INTEGER(j1);
168 c##TYPE *px0 = c##PTR(x0), *px1 = c##PTR(x1); \
169 for (k = 0; k < nnz0; ++k) \
170 if (NZ(c, px0[k])) { \
183 Rcomplex *px0 = COMPLEX(x0), *px1 = COMPLEX(x1);
184 for (k = 0; k < nnz0; ++k)
185 if ((pi0[k] == pj0[k]) ?
NZ(d, px0[k].r) :
NZ(z, px0[k])) {
198 int *pdim =
DIM(from), m = pdim[0], n = pdim[1];
201 if (
class[1] !=
'g' &&
UPLO(from) !=
'U')
203 if (
class[1] ==
's' &&
class[0] ==
'z' && ct !=
'C')
205 if (
class[1] ==
't' &&
DIAG(from) !=
'N')