54 int *pdim =
DIM(s_obj), m = pdim[0], n = pdim[1];
56 return Rf_ScalarReal(0.0);
59 double norm, *work = NULL;
61 work = (
double *) R_alloc((
size_t) m,
sizeof(
double));
64 F77_CALL(zlange)(&type, &m, &n, COMPLEX(x), &m, work
FCONE);
67 F77_CALL(dlange)(&type, &m, &n, REAL(x), &m, work
FCONE);
70 return Rf_ScalarReal(norm);
77 int n =
DIM(s_obj)[1];
79 return Rf_ScalarReal(0.0);
80 char ul =
UPLO(s_obj);
83 double norm, *work = NULL;
84 if (type ==
'O' || type ==
'I')
85 work = (
double *) R_alloc((
size_t) n,
sizeof(
double));
86 if (
TYPEOF(x) == CPLXSXP) {
87 if (
TRANS(s_obj) ==
'C')
89 F77_CALL(zlanhe)(&type, &ul, &n, COMPLEX(x), &n, work
FCONE FCONE);
92 F77_CALL(zlansy)(&type, &ul, &n, COMPLEX(x), &n, work
FCONE FCONE);
96 F77_CALL(dlansy)(&type, &ul, &n, REAL(x), &n, work
FCONE FCONE);
99 return Rf_ScalarReal(norm);
106 int n =
DIM(s_obj)[1];
108 return Rf_ScalarReal(0.0);
109 char ul =
UPLO(s_obj);
112 double norm, *work = NULL;
113 if (type ==
'O' || type ==
'I')
114 work = (
double *) R_alloc((
size_t) n,
sizeof(
double));
115 if (
TYPEOF(x) == CPLXSXP) {
116 if (
TRANS(s_obj) ==
'C')
118 F77_CALL(zlanhp)(&type, &ul, &n, COMPLEX(x), work
FCONE FCONE);
121 F77_CALL(zlansp)(&type, &ul, &n, COMPLEX(x), work
FCONE FCONE);
125 F77_CALL(dlansp)(&type, &ul, &n, REAL(x), work
FCONE FCONE);
128 return Rf_ScalarReal(norm);
135 int n =
DIM(s_obj)[1];
137 return Rf_ScalarReal(0.0);
138 char ul =
UPLO(s_obj), nu =
DIAG(s_obj);
141 double norm, *work = NULL;
143 work = (
double *) R_alloc((
size_t) n,
sizeof(
double));
146 F77_CALL(zlantr)(&type, &ul, &nu, &n, &n, COMPLEX(x), &n, work
FCONE FCONE FCONE);
149 F77_CALL(dlantr)(&type, &ul, &nu, &n, &n, REAL(x), &n, work
FCONE FCONE FCONE);
152 return Rf_ScalarReal(norm);
159 int n =
DIM(s_obj)[1];
161 return Rf_ScalarReal(0.0);
162 char ul =
UPLO(s_obj), nu =
DIAG(s_obj);
165 double norm, *work = NULL;
167 work = (
double *) R_alloc((
size_t) n,
sizeof(
double));
170 F77_CALL(zlantp)(&type, &ul, &nu, &n, COMPLEX(x), work
FCONE FCONE FCONE);
173 F77_CALL(dlantp)(&type, &ul, &nu, &n, REAL(x), work
FCONE FCONE FCONE);
176 return Rf_ScalarReal(norm);