14 if ((s = VECTOR_ELT(adn, 1)) != R_NilValue)
15 SET_VECTOR_ELT(rdn, 0, s);
16 if ((s = VECTOR_ELT(bdn, 1)) != R_NilValue)
17 SET_VECTOR_ELT(rdn, 1, s);
18 PROTECT(adn = Rf_getAttrib(adn, R_NamesSymbol));
19 PROTECT(bdn = Rf_getAttrib(bdn, R_NamesSymbol));
20 if (adn != R_NilValue || bdn != R_NilValue) {
21 PROTECT(s = Rf_allocVector(STRSXP, 2));
22 if (adn != R_NilValue)
23 SET_STRING_ELT(s, 0, STRING_ELT(adn, 1));
24 if (bdn != R_NilValue)
25 SET_STRING_ELT(s, 1, STRING_ELT(bdn, 1));
26 Rf_setAttrib(rdn, R_NamesSymbol, s);
37 int *padim = DIM(s_a), m = padim[0], n = padim[1]; \
39 Rf_error(_("'%s' is not square"), "a"); \
40 if (s_b != R_NilValue) { \
41 int *pbdim = DIM(s_b); \
43 Rf_error(_("dimensions of '%s' and '%s' are inconsistent"), \
49 SEXP rdimnames = PROTECT(DIMNAMES(r, 0)), \
50 adimnames = PROTECT(DIMNAMES(s_a, 0)); \
51 if (s_b == R_NilValue) \
52 cpyDN(rdimnames, adimnames, 1); \
54 SEXP bdimnames = PROTECT(DIMNAMES(s_b, 0)); \
55 solveDN(rdimnames, adimnames, bdimnames); \
63 if (s_b != R_NilValue) {
67 ax = Rf_coerceVector(ax, CPLXSXP);
68 bx = Rf_coerceVector(bx, CPLXSXP);
75 char rcl[] =
".geMatrix";
76 rcl[0] = (
TYPEOF(ax) == CPLXSXP) ?
'z' :
'd';
84 if (s_b == R_NilValue) {
87 if (
TYPEOF(ax) == CPLXSXP) {
88 Rcomplex work0, *work = &work0;
89 F77_CALL(zgetri)(&m, COMPLEX(rx), &m, INTEGER(apivot),
92 lwork = (int) work0.r;
93 work = (Rcomplex *) R_alloc((
size_t) lwork,
sizeof(Rcomplex));
94 F77_CALL(zgetri)(&m, COMPLEX(rx), &m, INTEGER(apivot),
98 double work0, *work = &work0;
99 F77_CALL(dgetri)(&m, REAL(rx), &m, INTEGER(apivot),
100 work, &lwork, &info);
103 work = (
double *) R_alloc((
size_t) lwork,
sizeof(
double ));
104 F77_CALL(dgetri)(&m, REAL(rx), &m, INTEGER(apivot),
105 work, &lwork, &info);
110 if (
TYPEOF(ax) == CPLXSXP) {
111 F77_CALL(zgetrs)(
"N", &m, &n, COMPLEX(ax), &m, INTEGER(apivot),
112 COMPLEX(rx), &m, &info
FCONE);
115 F77_CALL(dgetrs)(
"N", &m, &n, REAL(ax), &m, INTEGER(apivot),
116 REAL(rx), &m, &info
FCONE);
135 bx = R_NilValue, obx = bx;
136 if (s_b != R_NilValue) {
140 ax = Rf_coerceVector(ax, CPLXSXP);
141 bx = Rf_coerceVector(bx, CPLXSXP);
148 int packed = XLENGTH(ax) != (int_fast64_t) m * m;
150 char rcl[] =
"...Matrix";
151 rcl[0] = (
TYPEOF(ax) == CPLXSXP) ?
'z' :
'd';
152 if (s_b == R_NilValue) {
154 rcl[2] = (!packed) ?
'y' :
'p';
163 char aul =
UPLO(s_a);
164 if (s_b == R_NilValue && aul !=
'U')
167 char act = (
TYPEOF(ax) == CPLXSXP && ax == oax) ?
TRANS(s_a) :
'C';
168 if (s_b == R_NilValue && act !=
'C')
174 if (s_b == R_NilValue) {
176 if (
TYPEOF(ax) == CPLXSXP) {
177 Rcomplex *work = (Rcomplex *) R_alloc((
size_t) m,
sizeof(Rcomplex));
180 F77_CALL(zhetri)(&aul, &m, COMPLEX(rx), &m, INTEGER(apivot),
184 F77_CALL(zhptri)(&aul, &m, COMPLEX(rx), INTEGER(apivot),
190 F77_CALL(zsytri)(&aul, &m, COMPLEX(rx), &m, INTEGER(apivot),
194 F77_CALL(zsptri)(&aul, &m, COMPLEX(rx), INTEGER(apivot),
200 double *work = (
double *) R_alloc((
size_t) m,
sizeof(
double ));
202 F77_CALL(dsytri)(&aul, &m, REAL(rx), &m, INTEGER(apivot),
206 F77_CALL(dsptri)(&aul, &m, REAL(rx), INTEGER(apivot),
213 if (
TYPEOF(ax) == CPLXSXP) {
216 F77_CALL(zhetrs)(&aul, &m, &n, COMPLEX(ax), &m, INTEGER(apivot),
217 COMPLEX(rx), &m, &info
FCONE);
220 F77_CALL(zhptrs)(&aul, &m, &n, COMPLEX(ax), INTEGER(apivot),
221 COMPLEX(rx), &m, &info
FCONE);
226 F77_CALL(zsytrs)(&aul, &m, &n, COMPLEX(ax), &m, INTEGER(apivot),
227 COMPLEX(rx), &m, &info
FCONE);
230 F77_CALL(zsptrs)(&aul, &m, &n, COMPLEX(ax), INTEGER(apivot),
231 COMPLEX(rx), &m, &info
FCONE);
237 F77_CALL(dsytrs)(&aul, &m, &n, REAL(ax), &m, INTEGER(apivot),
238 REAL(rx), &m, &info
FCONE);
241 F77_CALL(dsptrs)(&aul, &m, &n, REAL(ax), INTEGER(apivot),
242 REAL(rx), &m, &info
FCONE);
262 if (s_b != R_NilValue) {
266 ax = Rf_coerceVector(ax, CPLXSXP);
267 bx = Rf_coerceVector(bx, CPLXSXP);
274 int packed = XLENGTH(ax) != (int_fast64_t) m * m;
276 char rcl[] =
"...Matrix";
277 rcl[0] = (
TYPEOF(ax) == CPLXSXP) ?
'z' :
'd';
278 if (s_b == R_NilValue) {
280 rcl[2] = (!packed) ?
'o' :
'p';
289 char aul =
UPLO(s_a);;
290 if (s_b == R_NilValue && aul !=
'U')
295 int info, pivoted =
TYPEOF(aperm) == INTSXP && LENGTH(aperm) > 0;
296 if (s_b == R_NilValue) {
297 PROTECT(rx = Rf_allocVector(
TYPEOF(ax), XLENGTH(ax)));
298 if (
TYPEOF(ax) == CPLXSXP) {
299 memcpy(COMPLEX(rx), COMPLEX(ax),
sizeof(Rcomplex) * (
size_t) XLENGTH(ax));
301 F77_CALL(zpotri)(&aul, &m, COMPLEX(rx), &m, &info
FCONE);
304 m, aul, (pivoted) ? INTEGER(aperm) : NULL, 1, 1);
306 F77_CALL(zpptri)(&aul, &m, COMPLEX(rx), &info
FCONE);
309 m, aul, (pivoted) ? INTEGER(aperm) : NULL, 1, 1);
312 memcpy( REAL(rx), REAL(ax),
sizeof(
double) * (
size_t) XLENGTH(ax));
314 F77_CALL(dpotri)(&aul, &m, REAL(rx), &m, &info
FCONE);
317 m, aul, (pivoted) ? INTEGER(aperm) : NULL, 1, 1);
319 F77_CALL(dpptri)(&aul, &m, REAL(rx), &info
FCONE);
322 m, aul, (pivoted) ? INTEGER(aperm) : NULL, 1, 1);
326 PROTECT(rx = Rf_allocVector(
TYPEOF(ax), XLENGTH(bx)));
327 if (
TYPEOF(ax) == CPLXSXP) {
329 m, n, (pivoted) ? INTEGER(aperm) : NULL, 1, 0);
331 F77_CALL(zpotrs)(&aul, &m, &n, COMPLEX(ax), &m,
332 COMPLEX(rx), &m, &info
FCONE);
335 F77_CALL(zpptrs)(&aul, &m, &n, COMPLEX(ax),
336 COMPLEX(rx), &m, &info
FCONE);
340 m, n, (pivoted) ? INTEGER(aperm) : NULL, 1, 1);
343 m, n, (pivoted) ? INTEGER(aperm) : NULL, 1, 0);
345 F77_CALL(dpotrs)(&aul, &m, &n, REAL(ax), &m,
346 REAL(rx), &m, &info
FCONE);
349 F77_CALL(dpptrs)(&aul, &m, &n, REAL(ax),
350 REAL(rx), &m, &info
FCONE);
354 m, n, (pivoted) ? INTEGER(aperm) : NULL, 1, 1);
372 if (s_b != R_NilValue) {
376 ax = Rf_coerceVector(ax, CPLXSXP);
377 bx = Rf_coerceVector(bx, CPLXSXP);
384 int packed = XLENGTH(ax) != (int_fast64_t) m * m;
386 char rcl[] =
"...Matrix";
387 rcl[0] = (
TYPEOF(ax) == CPLXSXP) ?
'z' :
'd';
388 if (s_b == R_NilValue) {
390 rcl[2] = (!packed) ?
'r' :
'p';
399 char aul =
UPLO(s_a);
400 if (s_b == R_NilValue && aul !=
'U')
403 char anu =
DIAG(s_a);
404 if (s_b == R_NilValue && anu !=
'N')
410 if (s_b == R_NilValue) {
412 if (
TYPEOF(ax) == CPLXSXP) {
414 F77_CALL(ztrtri)(&aul, &anu, &m, COMPLEX(rx), &m,
418 F77_CALL(ztptri)(&aul, &anu, &m, COMPLEX(rx),
424 F77_CALL(dtrtri)(&aul, &anu, &m, REAL(rx), &m,
428 F77_CALL(dtptri)(&aul, &anu, &m, REAL(rx),
435 if (
TYPEOF(ax) == CPLXSXP) {
437 F77_CALL(ztrtrs)(&aul,
"N", &anu, &m, &n, COMPLEX(ax), &m,
441 F77_CALL(ztptrs)(&aul,
"N", &anu, &m, &n, COMPLEX(ax),
447 F77_CALL(dtrtrs)(&aul,
"N", &anu, &m, &n, REAL(ax), &m,
451 F77_CALL(dtptrs)(&aul,
"N", &anu, &m, &n, REAL(ax),
477 *pap = (LENGTH(ap)) ? INTEGER(ap) : NULL,
478 *paq = (LENGTH(aq)) ? INTEGER(aq) : NULL;
483 size_t n = (size_t) (A)->nzmax; \
484 double *x = (double *) (A)->x; \
485 Rcomplex *y = (Rcomplex *) R_alloc(n, sizeof(Rcomplex)); \
486 while (n-- > 0) { (*(y)).r = *(x++); (*(y++)).i = 0.0; } \
488 (A)->xtype = CXSPARSE_COMPLEX; \
497 if (!Rf_asLogical(s_sparse)) {
498 if ((int_fast64_t) m * n > R_XLEN_T_MAX)
499 Rf_error(
_(
"attempt to allocate vector of length exceeding %s"),
501 char rcl[] =
".geMatrix";
505 R_xlen_t mn = (R_xlen_t) m * n;
507 if (s_b == R_NilValue) {
509#define SOLVE_DENSE(c) \
511 c##TYPE *prx = c##PTR(rx), \
512 *work = (c##TYPE *) R_alloc((size_t) m, sizeof(c##TYPE)); \
513 memset(prx, 0, sizeof(c##TYPE) * (size_t) mn); \
514 for (j = 0; j < n; ++j) { \
516 Matrix_cs_pvec(pap, prx, work, m); \
517 Matrix_cs_lsolve(L, work); \
518 Matrix_cs_usolve(U, work); \
519 Matrix_cs_ipvec(paq, work, prx, m); \
535 bx = Rf_coerceVector(bx, CPLXSXP);
540#define SOLVE_DENSE(c) \
542 c##TYPE *prx = c##PTR(rx), *pbx = c##PTR(bx), \
543 *work = (c##TYPE *) R_alloc((size_t) m, sizeof(c##TYPE)); \
544 for (j = 0; j < n; ++j) { \
545 Matrix_cs_pvec(pap, pbx, work, m); \
546 Matrix_cs_lsolve(L, work); \
547 Matrix_cs_usolve(U, work); \
548 Matrix_cs_ipvec(paq, work, prx, m); \
567 if (s_b == R_NilValue) {
570 for (i = 0; i < m; ++i)
586 int Bfr = s_b == R_NilValue || pap;
588 int k, top, nz, nzmax,
589 *iwork = (
int *) R_alloc((
size_t) m * 2,
sizeof(
int));
591#define SOLVE_SPARSE_TRIANGULAR(c, _A_, _ALO_, _BFR_) \
593 X = Matrix_cs_spalloc(m, n, B->nzmax, 1, 0); \
596 B = Matrix_cs_spfree(B); \
597 ERROR_OOM(__func__); \
599 c##TYPE *X__x = (c##TYPE *) X->x; \
602 for (j = 0, k = 0; j < n; ++j) { \
603 top = Matrix_cs_spsolve(_A_, B, j, iwork, work, NULL, _ALO_); \
604 if (m - top > INT_MAX - nz) { \
606 B = Matrix_cs_spfree(B); \
607 X = Matrix_cs_spfree(X); \
608 Rf_error(_("attempt to construct %s with more than %s nonzero elements"), \
609 "sparseMatrix", "2^31-1"); \
613 nzmax = (nz <= INT_MAX / 2) ? 2 * nz : INT_MAX; \
614 if (!Matrix_cs_sprealloc(X, nzmax)) { \
616 B = Matrix_cs_spfree(B); \
617 X = Matrix_cs_spfree(X); \
618 ERROR_OOM(__func__); \
620 X__x = (c##TYPE *) X->x; \
624 for (i = top; i < m; ++i) { \
625 X->i[k] = iwork[i] ; \
626 X__x[k] = work[iwork[i]]; \
630 for (i = m - 1; i >= top; --i) { \
631 X->i[k] = iwork[i] ; \
632 X__x[k] = work[iwork[i]]; \
638 B = Matrix_cs_spfree(B); \
642#define SOLVE_SPARSE(c) \
644 c##TYPE *work = (c##TYPE *) R_alloc((size_t) m, sizeof(c##TYPE)); \
645 SOLVE_SPARSE_TRIANGULAR(c, L, 1, Bfr); \
646 SOLVE_SPARSE_TRIANGULAR(c, U, 0, 1); \
675 PROTECT(r =
CXS2M(B, 1,
'g'));
689 while (nms[i][0] !=
'\0') {
690 if (strcmp(s, nms[i]) == 0)
700 static const char *valid[] = {
701 "A",
"LDLt",
"LD",
"DLt",
"L",
"Lt",
"D",
"P",
"Pt",
"" };
703 if (
TYPEOF(s_system) != STRSXP || LENGTH(s_system) < 1 ||
704 (s_system = STRING_ELT(s_system, 0)) == NA_STRING ||
705 (ivalid =
strmatch(CHAR(s_system), valid)) < 0)
706 Rf_error(
_(
"invalid '%s' to '%s'"),
"system", __func__);
711 size_t m_ = (size_t) m, n_ = (
size_t) n;
712 cholmod_factor *L =
M2CHF(s_a, 1);
713 if (!Rf_asLogical(s_sparse)) {
714 if ((int_fast64_t) m * n > R_XLEN_T_MAX)
715 Rf_error(
_(
"attempt to allocate vector of length exceeding %s"),
717 cholmod_dense *B = NULL, *X = NULL;
718 if (s_b == R_NilValue) {
719 B = cholmod_eye(m_, n_, L->xtype + L->dtype, &
c);
722 X = cholmod_solve(ivalid, L, B, &
c);
723 cholmod_free_dense(&B, &
c);
726 PROTECT(r =
CHD2M(X,
'N', (ivalid < 2) ? ((L->is_ll) ?
'p' :
's') : ((ivalid < 7) ?
't' :
'g')));
729 X = cholmod_solve(ivalid, L, B, &
c);
732 PROTECT(r =
CHD2M(X,
'N',
'g'));
734 cholmod_free_dense(&X, &
c);
736 cholmod_sparse *B = NULL, *X = NULL;
737 if (s_b == R_NilValue) {
738 B = cholmod_speye(m_, n_, L->xtype + L->dtype, &
c);
741 X = cholmod_spsolve(ivalid, L, B, &
c);
742 cholmod_free_sparse(&B, &
c);
743 if (X && ivalid < 7) {
746 B = cholmod_copy(X, (ivalid == 2 || ivalid == 4) ? -1 : 1, 1, &
c);
747 cholmod_free_sparse(&X, &
c);
752 PROTECT(r =
CHS2M(X, 1, (ivalid < 2) ? ((L->is_ll) ?
'p' :
's') : ((ivalid < 7) ?
't' :
'g')));
755 X = cholmod_spsolve(ivalid, L, B, &
c);
758 PROTECT(r =
CHS2M(X, 1,
'g'));
760 cholmod_free_sparse(&X, &
c);
762 if (s_b == R_NilValue && (ivalid == 2 || ivalid == 4))
776 char aul =
UPLO(s_a);
783 if (!Rf_asLogical(s_sparse)) {
784 if ((int_fast64_t) m * n > R_XLEN_T_MAX)
785 Rf_error(
_(
"attempt to allocate vector of length exceeding %s"),
787 char rcl[] =
"...Matrix";
789 rcl[1] = (s_b == R_NilValue) ?
't' :
'g';
790 rcl[2] = (s_b == R_NilValue) ?
'r' :
'e';
793 R_xlen_t mn = (R_xlen_t) m * n;
795 if (s_b == R_NilValue) {
797#define SOLVE_DENSE(c) \
799 c##TYPE *prx = c##PTR(rx); \
800 memset(prx, 0, sizeof(c##TYPE) * (size_t) mn); \
801 for (j = 0; j < n; ++j) { \
804 Matrix_cs_usolve(A, prx); \
806 Matrix_cs_lsolve(A, prx); \
822 bx = Rf_coerceVector(bx, CPLXSXP);
827#define SOLVE_DENSE(c) \
829 c##TYPE *prx = c##PTR(rx), *pbx = c##PTR(bx); \
830 memcpy(prx, pbx, sizeof(c##TYPE) * (size_t) mn); \
831 for (j = 0; j < n; ++j) { \
833 Matrix_cs_usolve(A, prx); \
835 Matrix_cs_lsolve(A, prx); \
853 if (s_b == R_NilValue)
863 int k, top, nz, nzmax,
864 *iwork = (
int *) R_alloc((
size_t) m * 2,
sizeof(
int));
866#define SOLVE_SPARSE(c) \
868 c##TYPE *work = (c##TYPE *) R_alloc((size_t) m, sizeof(c##TYPE)); \
869 SOLVE_SPARSE_TRIANGULAR(c, A, aul != 'U', s_b == R_NilValue); \
890 PROTECT(r =
CXS2M(B, 1, (s_b == R_NilValue) ?
't' :
'g'));
893 if (s_b == R_NilValue && aul !=
'U')
903 SEXP s_complete, SEXP s_yxjj)
908 ((s_y != R_NilValue &&
910 (s_yxjj != R_NilValue &&
911 TYPEOF(s_yxjj) == CPLXSXP)))
916 double *pbeta = REAL(beta);
919 int *pp = (LENGTH(p) > 0) ? INTEGER(p) : NULL;
921 int m = V_->
m, r = V_->
n, n, i, j, op = Rf_asInteger(s_op),
925 if (s_y == R_NilValue) {
926 n = (Rf_asLogical(s_complete)) ? m : r;
927 if ((int_fast64_t) m * n > R_XLEN_T_MAX)
928 Rf_error(
_(
"attempt to allocate vector of length exceeding %s"),
930 R_xlen_t mn = (R_xlen_t) m * n;
935 c##TYPE *pyx = c##PTR(yx); \
936 memset(pyx, 0, sizeof(c##TYPE) * (size_t) mn); \
937 if (s_yxjj == R_NilValue) { \
938 c##TYPE one = c##UNIT; \
939 c##NAME(copy2)((size_t) n, \
940 pyx, (size_t) m + 1, &one, 0); \
942 s_yxjj = Rf_coerceVector(s_yxjj, c##TYPESXP); \
943 c##TYPE *pyxjj = c##PTR(s_yxjj); \
944 c##NAME(copy2)((size_t) n, \
945 pyx, (size_t) m + 1, pyxjj, 1); \
957 int *pydim =
DIM(s_y);
959 Rf_error(
_(
"dimensions of '%s' and '%s' are inconsistent"),
966 yx = Rf_coerceVector(yx, CPLXSXP);
972 char acl[] =
".geMatrix";
977 padim[0] = (op != 0) ? m : r;
981 if (s_y == R_NilValue && padim[0] == m)
984 R_xlen_t mn = (R_xlen_t) padim[0] * padim[1];
992 c##TYPE *pyx = c##PTR(yx), *pax = c##PTR(ax), *work = NULL; \
994 work = (c##TYPE *) R_alloc((size_t) m, sizeof(c##TYPE)); \
998 SEXP R = PROTECT(GET_SLOT(s_qr, Matrix_RSym)), \
999 q = PROTECT(GET_SLOT(s_qr, Matrix_qSym)); \
1000 Matrix_cs *R_ = M2CXS(R, 1); \
1001 if (V_->xtype == CXSPARSE_COMPLEX && R_->xtype != V_->xtype) \
1003 int *pq = (LENGTH(q) > 0) ? INTEGER(q) : NULL; \
1004 for (j = 0; j < n; ++j) { \
1005 Matrix_cs_pvec(pp, pyx, work, m); \
1006 for (i = 0; i < r; ++i) \
1007 Matrix_cs_happly(V_, i, pbeta[i], work); \
1008 Matrix_cs_usolve(R_, work); \
1009 Matrix_cs_ipvec(pq, work, pax, r); \
1017 for (j = 0; j < n; ++j) { \
1018 Matrix_cs_pvec(pp, pyx, work, m); \
1019 for (i = 0; i < r; ++i) \
1020 Matrix_cs_happly(V_, i, pbeta[i], work); \
1022 memset(work + r, 0, sizeof(c##TYPE) * (size_t) (m - r)); \
1023 for (i = r - 1; i >= 0; --i) \
1024 Matrix_cs_happly(V_, i, pbeta[i], work); \
1025 Matrix_cs_ipvec(pp, work, pax, m); \
1031 for (j = 0; j < n; ++j) { \
1032 Matrix_cs_pvec(pp, pyx, work, m); \
1033 for (i = 0; i < r; ++i) \
1034 Matrix_cs_happly(V_, i, pbeta[i], work); \
1036 memset(work, 0, sizeof(c##TYPE) * (size_t) r); \
1037 for (i = r - 1; i >= 0; --i) \
1038 Matrix_cs_happly(V_, i, pbeta[i], work); \
1039 Matrix_cs_ipvec(pp, work, pax, m); \
1045 for (j = 0; j < n; ++j) { \
1046 Matrix_cs_pvec(pp, pyx, work, m); \
1047 memcpy(pax, work, sizeof(c##TYPE) * (size_t) m); \
1048 for (i = 0; i < r; ++i) \
1049 Matrix_cs_happly(V_, i, pbeta[i], pax); \
1055 for (j = 0; j < n; ++j) { \
1056 memcpy(work, pyx, sizeof(c##TYPE) * (size_t) m); \
1057 for (i = r - 1; i >= 0; --i) \
1058 Matrix_cs_happly(V_, i, pbeta[i], work); \
1059 Matrix_cs_ipvec(pp, work, pax, m); \
1066 memcpy(pax, pyx, sizeof(c##TYPE) * (size_t) m * (size_t) n); \
1067 for (j = 0; j < n; ++j) { \
1068 for (i = 0; i < r; ++i) \
1069 Matrix_cs_happly(V_, i, pbeta[i], pax); \
1075 memcpy(pax, pyx, sizeof(c##TYPE) * (size_t) m * (size_t) n); \
1076 for (j = 0; j < n; ++j) { \
1077 for (i = r - 1; i >= 0; --i) \
1078 Matrix_cs_happly(V_, i, pbeta[i], pax); \
1083 Rf_error(_("invalid '%s' to '%s'"), "op", __func__); \
1095 UNPROTECT(nprotect);
#define ERROR_LAPACK_1(_ROUTINE_, _INFO_)
#define ERROR_LAPACK_2(_ROUTINE_, _INFO_, _WARN_, _LETTER_)
#define ERROR_OOM(_FUNC_)
SEXP duplicateVector(SEXP)
#define GET_SLOT(x, name)
SEXP newObject(const char *)
#define SET_SLOT(x, name, value)
cholmod_factor * M2CHF(SEXP obj, int values)
cholmod_sparse * M2CHS(SEXP obj, int values)
SEXP CHS2M(cholmod_sparse *A, int values, char shape)
cholmod_dense * M2CHD(SEXP obj, char trans)
SEXP CHD2M(cholmod_dense *A, char trans, char shape)
Matrix_cs * Matrix_cs_transpose(const Matrix_cs *A, int values)
Matrix_cs * Matrix_cs_spfree(Matrix_cs *A)
void * Matrix_cs_free(void *p)
Matrix_cs * Matrix_cs_permute(const Matrix_cs *A, const int *pinv, const int *q, int values)
SEXP CXS2M(Matrix_cs *A, int values, char shape)
Matrix_cs * Matrix_cs_speye(int m, int n, int values, int triplet)
int * Matrix_cs_pinv(const int *p, int n)
int Matrix_cs_dropzeros(Matrix_cs *A)
Matrix_cs * M2CXS(SEXP obj, int values)
#define CXSPARSE_XTYPE_SET(_VALUE_)
void dsymperm2(double *, const double *, int, char, const int *, int, int)
void zsymperm2(Rcomplex *, const Rcomplex *, int, char, const int *, int, int)
void zsymperm1(Rcomplex *, const Rcomplex *, int, char, const int *, int, int)
void drowperm2(double *, const double *, int, int, const int *, int, int)
void dsymperm1(double *, const double *, int, char, const int *, int, int)
void zrowperm2(Rcomplex *, const Rcomplex *, int, int, const int *, int, int)
SEXP sparseCholesky_solve(SEXP s_a, SEXP s_b, SEXP s_sparse, SEXP s_system)
SEXP denseBunchKaufman_solve(SEXP s_a, SEXP s_b)
SEXP denseLU_solve(SEXP s_a, SEXP s_b)
static int strmatch(const char *s, const char **nms)
SEXP sparseQR_matmult(SEXP s_qr, SEXP s_y, SEXP s_op, SEXP s_complete, SEXP s_yxjj)
SEXP tCMatrix_solve(SEXP s_a, SEXP s_b, SEXP s_sparse)
SEXP sparseLU_solve(SEXP s_a, SEXP s_b, SEXP s_sparse)
static void solveDN(SEXP rdn, SEXP adn, SEXP bdn)
SEXP denseCholesky_solve(SEXP s_a, SEXP s_b)
SEXP trMatrix_solve(SEXP s_a, SEXP s_b)