44 int *pdim =
DIM(s_obj), n = pdim[1];
46 Rf_error(
_(
"non-square matrix arguments not supported by '%s'"),
49 return(Rf_ScalarReal(R_PosInf));
55 double * work = (
double *) R_alloc((
size_t) n * 4,
sizeof(
double));
56 if (
TYPEOF(x) == CPLXSXP) {
57 double *rwork = (
double *) R_alloc((
size_t) n * 2,
sizeof(
double));
59 F77_CALL(zlange)(&type, &n, &n, COMPLEX(x), &n, work
FCONE);
60 F77_CALL(zgecon)(&type, &n, COMPLEX(y), &n, &norm, &rcond,
61 (Rcomplex *) work, rwork, &info
FCONE);
63 int *iwork = (
int *) R_alloc((
size_t) n ,
sizeof(
int ));
65 F77_CALL(dlange)(&type, &n, &n, REAL(x), &n, work
FCONE);
66 F77_CALL(dgecon)(&type, &n, REAL(y), &n, &norm, &rcond,
67 (
double *) work, iwork, &info
FCONE);
71 return Rf_ScalarReal(rcond);
78 int n =
DIM(s_obj)[0];
80 return(Rf_ScalarReal(R_PosInf));
81 char ul =
UPLO(s_obj);
88 if (
TYPEOF(x) == CPLXSXP) {
89 double * work = (
double *) R_alloc((
size_t) n * 4,
sizeof(
double));
90 if (
TRANS(s_obj) ==
'C') {
92 F77_CALL(zlanhe)(&type, &ul, &n, COMPLEX(x), &n, work
FCONE FCONE);
93 F77_CALL(zhecon)( &ul, &n, COMPLEX(y), &n, INTEGER(pivot), &norm, &rcond,
94 (Rcomplex *) work, &info
FCONE);
97 F77_CALL(zlansy)(&type, &ul, &n, COMPLEX(x), &n, work
FCONE FCONE);
98 F77_CALL(zsycon)( &ul, &n, COMPLEX(y), &n, INTEGER(pivot), &norm, &rcond,
99 (Rcomplex *) work, &info
FCONE);
102 double * work = (
double *) R_alloc((
size_t) n * 2,
sizeof(
double));
103 int *iwork = (
int *) R_alloc((
size_t) n ,
sizeof(
int ));
105 F77_CALL(dlansy)(&type, &ul, &n, REAL(x), &n, work
FCONE FCONE);
106 F77_CALL(dsycon)( &ul, &n, REAL(y), &n, INTEGER(pivot), &norm, &rcond,
107 (
double *) work, iwork, &info
FCONE);
111 return Rf_ScalarReal(rcond);
118 int n =
DIM(s_obj)[1];
120 return(Rf_ScalarReal(R_PosInf));
121 char ul =
UPLO(s_obj);
128 if (
TYPEOF(x) == CPLXSXP) {
129 double * work = (
double *) R_alloc((
size_t) n * 4,
sizeof(
double));
130 if (
TRANS(s_obj) ==
'C') {
132 F77_CALL(zlanhp)(&type, &ul, &n, COMPLEX(x), work
FCONE FCONE);
133 F77_CALL(zhpcon)( &ul, &n, COMPLEX(y), INTEGER(pivot), &norm, &rcond,
134 (Rcomplex *) work, &info
FCONE);
137 F77_CALL(zlansp)(&type, &ul, &n, COMPLEX(x), work
FCONE FCONE);
138 F77_CALL(zspcon)( &ul, &n, COMPLEX(y), INTEGER(pivot), &norm, &rcond,
139 (Rcomplex *) work, &info
FCONE);
142 double * work = (
double *) R_alloc((
size_t) n * 2,
sizeof(
double));
143 int *iwork = (
int *) R_alloc((
size_t) n ,
sizeof(
int ));
145 F77_CALL(dlansp)(&type, &ul, &n, REAL(x), work
FCONE FCONE);
146 F77_CALL(dspcon)( &ul, &n, REAL(y), INTEGER(pivot), &norm, &rcond,
147 (
double *) work, iwork, &info
FCONE);
151 return Rf_ScalarReal(rcond);
158 int n =
DIM(s_obj)[1];
160 return(Rf_ScalarReal(R_PosInf));
161 char ul =
UPLO(s_obj);
167 if (
TYPEOF(x) == CPLXSXP) {
168 double * work = (
double *) R_alloc((
size_t) n * 4,
sizeof(
double));
169 double *rwork = (
double *) R_alloc((
size_t) n ,
sizeof(
double));
171 F77_CALL(zlansy)(&type, &ul, &n, COMPLEX(x), &n, work
FCONE FCONE);
172 F77_CALL(zpocon)( &ul, &n, COMPLEX(y), &n, &norm, &rcond,
173 (Rcomplex *) work, rwork, &info
FCONE);
175 double * work = (
double *) R_alloc((
size_t) n * 3,
sizeof(
double));
176 int *iwork = (
int *) R_alloc((
size_t) n ,
sizeof(
int ));
178 F77_CALL(dlansy)(&type, &ul, &n, REAL(x), &n, work
FCONE FCONE);
179 F77_CALL(dpocon)( &ul, &n, REAL(y), &n, &norm, &rcond,
180 (
double *) work, iwork, &info
FCONE);
184 return Rf_ScalarReal(rcond);
191 int n =
DIM(s_obj)[1];
193 return(Rf_ScalarReal(R_PosInf));
194 char ul =
UPLO(s_obj);
200 if (
TYPEOF(x) == CPLXSXP) {
201 double * work = (
double *) R_alloc((
size_t) n * 4,
sizeof(
double));
202 double *rwork = (
double *) R_alloc((
size_t) n ,
sizeof(
double));
204 F77_CALL(zlansp)(&type, &ul, &n, COMPLEX(x), work
FCONE FCONE);
205 F77_CALL(zppcon)( &ul, &n, COMPLEX(y), &norm, &rcond,
206 (Rcomplex *) work, rwork, &info
FCONE);
208 double * work = (
double *) R_alloc((
size_t) n * 4,
sizeof(
double));
209 int *iwork = (
int *) R_alloc((
size_t) n ,
sizeof(
int ));
211 F77_CALL(dlansp)(&type, &ul, &n, REAL(x), work
FCONE FCONE);
212 F77_CALL(dppcon)( &ul, &n, REAL(y), &norm, &rcond,
213 (
double *) work, iwork, &info
FCONE);
217 return Rf_ScalarReal(rcond);
224 int n =
DIM(s_obj)[1];
226 return(Rf_ScalarReal(R_PosInf));
227 char ul =
UPLO(s_obj), nu =
DIAG(s_obj);
232 if (
TYPEOF(x) == CPLXSXP) {
233 double * work = (
double *) R_alloc((
size_t) n * 4,
sizeof(
double));
234 double *rwork = (
double *) R_alloc((
size_t) n ,
sizeof(
double));
235 F77_CALL(ztrcon)(&type, &ul, &nu, &n, COMPLEX(x), &n, &rcond,
238 double * work = (
double *) R_alloc((
size_t) n * 3,
sizeof(
double));
239 int *iwork = (
int *) R_alloc((
size_t) n ,
sizeof(
int ));
240 F77_CALL(dtrcon)(&type, &ul, &nu, &n, REAL(x), &n, &rcond,
245 return Rf_ScalarReal(rcond);
252 int n =
DIM(s_obj)[1];
254 return(Rf_ScalarReal(R_PosInf));
255 char ul =
UPLO(s_obj), nu =
DIAG(s_obj);
260 if (
TYPEOF(x) == CPLXSXP) {
261 double * work = (
double *) R_alloc((
size_t) n * 4,
sizeof(
double));
262 double *rwork = (
double *) R_alloc((
size_t) n ,
sizeof(
double));
263 F77_CALL(ztpcon)(&type, &ul, &nu, &n, COMPLEX(x), &rcond,
266 double * work = (
double *) R_alloc((
size_t) n * 3,
sizeof(
double));
267 int *iwork = (
int *) R_alloc((
size_t) n ,
sizeof(
int ));
268 F77_CALL(dtpcon)(&type, &ul, &nu, &n, REAL(x), &rcond,
273 return Rf_ScalarReal(rcond);