43 #include "amino/def.h"
49 static inline int AA_CLA_NAME(getrf)
50 (
int m,
int n, AA_TYPE *A,
int lda,
int *ipiv ) {
52 AA_LAPACK_NAME( getrf)
53 (&m, &n, A, &lda, ipiv, &info );
61 static inline int AA_CLA_NAME(getri)
62 (
int n, AA_TYPE *A,
int lda,
int *ipiv, AA_TYPE *work,
int lwork ) {
64 AA_LAPACK_NAME( getri )
65 ( &n, A, &lda, ipiv, work, &lwork, &info );
70 static inline int AA_CLA_NAME(gesdd)
71 (
char jobz,
int m,
int n,
75 AA_TYPE *VT,
int ldvt,
76 AA_TYPE *work,
int lwork,
80 AA_LAPACK_NAME(gesdd)( &jobz, &m, &n,
96 static inline int AA_CLA_NAME(geqrf)
97 (
int m,
int n, AA_TYPE *A,
int lda,
98 AA_TYPE *tau, AA_TYPE *work,
int lwork )
101 AA_LAPACK_NAME(geqrf)
102 (&m, &n, A, &lda, tau,
108 static inline int AA_CLA_NAME(orgqr)
109 (
const int m,
const int n,
const int k,
110 AA_TYPE *A,
const int lda,
const AA_TYPE *tau,
111 AA_TYPE *work,
const int lwork )
114 AA_LAPACK_NAME(orgqr)(&m, &n, &k,
116 work, &lwork, &info);
121 static inline int AA_CLA_NAME(posv)
122 (
char uplo,
int n,
int nrhs,
124 AA_TYPE *B,
int ldb )
127 AA_LAPACK_NAME(posv)(&uplo, &n, &nrhs,
135 static inline int AA_CLA_NAME(gelsd_smlsiz) () {
136 return aa_cla_ilaenv( 9, AA_LAPACK_PREFIX_STR
137 "GELSD",
"", 0, 0, 0, 0 );
141 static inline int AA_CLA_NAME(gelsd_nlvl)
144 int smlsiz = AA_CLA_NAME(gelsd_smlsiz)();
145 return (
int)
AA_MAX(0, 1 + log2( minmn / (1 + smlsiz)));
149 static inline int AA_CLA_NAME(gelsd_miniwork)
152 int nlvl = AA_CLA_NAME(gelsd_nlvl)(m,n);
154 3 * minmn * nlvl + 11 * minmn);
161 static inline int AA_CLA_NAME(gelsd)
162 (
int m,
int n,
int nrhs,
165 AA_TYPE *S, AA_TYPE *rcond,
int *rank,
166 AA_TYPE *work,
int lwork,
int *iwork ) {
168 AA_LAPACK_NAME( gelsd )
169 ( &m, &n, &nrhs, A, &lda, B, &ldb,
170 S, rcond, rank, work, &lwork, iwork, &info );
178 static inline void AA_CLA_NAME(lacpy)
179 (
char uplo,
int m,
int n,
180 const AA_TYPE *A,
int lda,
181 AA_TYPE *B,
int ldb ) {
182 AA_LAPACK_NAME(lacpy) (&uplo, &m, &n,
190 static inline void AA_CLA_NAME(laset)
191 (
char UPLO,
int M,
int N,
194 AA_TYPE *A,
int LDA )
196 AA_LAPACK_NAME(laset) (&UPLO, &M, &N,
205 static inline AA_TYPE AA_CLA_NAME(lapy2)
206 ( AA_TYPE x, AA_TYPE y )
208 return AA_LAPACK_NAME(lapy2)(&x, &y);
215 static inline AA_TYPE AA_CLA_NAME(lapy3)
216 ( AA_TYPE x, AA_TYPE y, AA_TYPE z )
218 return AA_LAPACK_NAME(lapy3)(&x, &y, &z);
225 static inline void AA_CLA_NAME(laruv)
226 (
int iseed[4],
int n, AA_TYPE *X )
228 AA_LAPACK_NAME(laruv) (iseed, &n, X);
235 static inline void AA_CLA_NAME(larnv)
236 (
int idist,
int iseed[4],
int n, AA_TYPE *X )
238 AA_LAPACK_NAME(larnv) (&idist, iseed, &n, X);
245 static inline int AA_CLA_NAME(lascl)
246 (
char TYPE,
int KL,
int KU,
247 AA_TYPE CFROM, AA_TYPE CTO,
248 int M,
int N, AA_TYPE *A,
int LDA ) {
250 AA_LAPACK_NAME( lascl )
251 ( &TYPE, &KL, &KU, &CFROM, &CTO,
252 &M, &N, A, &LDA, &info );
256 #if AA_TYPE == double
261 static inline int AA_CLA_NAME(lag2s)
264 float *SA,
int LDSA ) {
266 dlag2s_( &M, &N, A, &LDA, SA, &LDSA, &info);
270 #endif // AA_TYPE == double
277 static inline int AA_CLA_NAME(lag2d)
279 float * SA,
int LDSA,
280 double *A,
int LDA ) {
282 slag2d_( &M, &N, SA, &LDSA, A, &LDA, &info );
286 #endif // AA_TYPE == float
288 #include "amino/undef.h"
#define AA_MIN(a, b)
minimum of a and b
#define AA_MAX(a, b)
maximum of a and b