1 # 1 "doc/clapack_doc.c"
4 # 1 "/usr/include/stdc-predef.h" 1 3 4
39 # 52 "/usr/include/stdc-predef.h" 3 4
45 # 1 "<command-line>" 2
46 # 1 "doc/clapack_doc.c"
53 # 1 "./include/amino/clapack.h" 1
104 const char *name,
const char *opts,
105 int n1,
int n2,
int n3,
int n4 ) {
106 int nl = (int)strlen(name);
107 int ol = (int)strlen(opts);
108 return ilaenv_(&ispec, name, opts, &n1, &n2, &n3, &n4, nl, ol );
112 # 1 "./include/amino/clapack_impl.h" 1
155 # 1 "./include/amino/def.h" 1
156 # 42 "./include/amino/def.h"
157 # 1 "./include/amino/mangle.h" 1
158 # 43 "./include/amino/def.h" 2
159 # 44 "./include/amino/clapack_impl.h" 2
166 (
int m,
int n,
double *A,
int lda,
int *ipiv ) {
169 (&m, &n, A, &lda, ipiv, &info );
178 (
int n,
double *A,
int lda,
int *ipiv,
double *work,
int lwork ) {
181 ( &n, A, &lda, ipiv, work, &lwork, &info );
186 static inline int aa_cla_dgesdd
187 (
char jobz,
int m,
int n,
191 double *VT,
int ldvt,
192 double *work,
int lwork,
196 dgesdd_( &jobz, &m, &n,
213 (
int m,
int n,
double *A,
int lda,
214 double *tau,
double *work,
int lwork )
218 (&m, &n, A, &lda, tau,
224 static inline int aa_cla_dorgqr
225 (
const int m,
const int n,
const int k,
226 double *A,
const int lda,
const double *tau,
227 double *work,
const int lwork )
232 work, &lwork, &info);
237 static inline int aa_cla_dposv
238 (
char uplo,
int n,
int nrhs,
243 dposv_(&uplo, &n, &nrhs,
253 "GELSD",
"", 0, 0, 0, 0 );
261 return (
int)
AA_MAX(0, 1 + log2( minmn / (1 + smlsiz)));
270 3 * minmn * nlvl + 11 * minmn);
278 (
int m,
int n,
int nrhs,
281 double *S,
double *rcond,
int *rank,
282 double *work,
int lwork,
int *iwork ) {
285 ( &m, &n, &nrhs, A, &lda, B, &ldb,
286 S, rcond, rank, work, &lwork, iwork, &info );
295 (
char uplo,
int m,
int n,
296 const double *A,
int lda,
297 double *B,
int ldb ) {
307 (
char UPLO,
int M,
int N,
322 (
double x,
double y )
332 (
double x,
double y,
double z )
342 (
int iseed[4],
int n,
double *X )
352 (
int idist,
int iseed[4],
int n,
double *X )
354 dlarnv_ (&idist, iseed, &n, X);
362 (
char TYPE,
int KL,
int KU,
363 double CFROM,
double CTO,
364 int M,
int N,
double *A,
int LDA ) {
367 ( &TYPE, &KL, &KU, &CFROM, &CTO,
368 &M, &N, A, &LDA, &info );
380 float *SA,
int LDSA ) {
382 dlag2s_( &M, &N, A, &LDA, SA, &LDSA, &info);
395 float * SA,
int LDSA,
396 double *A,
int LDA ) {
398 slag2d_( &M, &N, SA, &LDSA, A, &LDA, &info );
404 # 1 "./include/amino/undef.h" 1
405 # 288 "./include/amino/clapack_impl.h" 2
406 # 60 "./include/amino/clapack.h" 2
410 # 1 "./include/amino/clapack_impl.h" 1
453 # 1 "./include/amino/def.h" 1
454 # 44 "./include/amino/clapack_impl.h" 2
461 (
int m,
int n,
float *A,
int lda,
int *ipiv ) {
464 (&m, &n, A, &lda, ipiv, &info );
473 (
int n,
float *A,
int lda,
int *ipiv,
float *work,
int lwork ) {
476 ( &n, A, &lda, ipiv, work, &lwork, &info );
481 static inline int aa_cla_sgesdd
482 (
char jobz,
int m,
int n,
487 float *work,
int lwork,
491 sgesdd_( &jobz, &m, &n,
508 (
int m,
int n,
float *A,
int lda,
509 float *tau,
float *work,
int lwork )
513 (&m, &n, A, &lda, tau,
519 static inline int aa_cla_sorgqr
520 (
const int m,
const int n,
const int k,
521 float *A,
const int lda,
const float *tau,
522 float *work,
const int lwork )
527 work, &lwork, &info);
532 static inline int aa_cla_sposv
533 (
char uplo,
int n,
int nrhs,
538 sposv_(&uplo, &n, &nrhs,
548 "GELSD",
"", 0, 0, 0, 0 );
556 return (
int)
AA_MAX(0, 1 + log2( minmn / (1 + smlsiz)));
565 3 * minmn * nlvl + 11 * minmn);
573 (
int m,
int n,
int nrhs,
576 float *S,
float *rcond,
int *rank,
577 float *work,
int lwork,
int *iwork ) {
580 ( &m, &n, &nrhs, A, &lda, B, &ldb,
581 S, rcond, rank, work, &lwork, iwork, &info );
590 (
char uplo,
int m,
int n,
591 const float *A,
int lda,
592 float *B,
int ldb ) {
602 (
char UPLO,
int M,
int N,
627 (
float x,
float y,
float z )
637 (
int iseed[4],
int n,
float *X )
647 (
int idist,
int iseed[4],
int n,
float *X )
649 slarnv_ (&idist, iseed, &n, X);
657 (
char TYPE,
int KL,
int KU,
658 float CFROM,
float CTO,
659 int M,
int N,
float *A,
int LDA ) {
662 ( &TYPE, &KL, &KU, &CFROM, &CTO,
663 &M, &N, A, &LDA, &info );
675 float *SA,
int LDSA ) {
677 dlag2s_( &M, &N, A, &LDA, SA, &LDSA, &info);
690 float * SA,
int LDSA,
691 double *A,
int LDA ) {
693 slag2d_( &M, &N, SA, &LDSA, A, &LDA, &info );
699 # 1 "./include/amino/undef.h" 1
700 # 288 "./include/amino/clapack_impl.h" 2
701 # 64 "./include/amino/clapack.h" 2
702 # 7 "doc/clapack_doc.c" 2
AA_API void dgetrf_(const int *M, const int *N, double *A, const int *LDA, int *IPIV, int *INFO)
Computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchange...
AA_API void dgetri_(const int *N, double *A, const int *LDA, const int *IPIV, double *WORK, const int *LWORK, int *INFO)
type for operations
AA_API void sgetri_(const int *N, float *A, const int *LDA, const int *IPIV, float *WORK, const int *LWORK, int *INFO)
type for operations
static void aa_cla_slacpy(char uplo, int m, int n, const float *A, int lda, float *B, int ldb)
Matrix copy.
#define AA_MIN(a, b)
minimum of a and b
static int aa_cla_sgeqrf(int m, int n, float *A, int lda, float *tau, float *work, int lwork)
Row Factor.
static void aa_cla_dlaruv(int iseed[4], int n, double *X)
Uniform random vector.
AA_API void slascl_(const char TYPE[1], const int *KL, const int *KU, const float *CFROM, const float *CTO, const int *M, const int *N, float *A, const int *LDA, int *INFO)
Multiplies the M by N real matrix A by the real scalar CTO/CFROM.
AA_API float slapy2_(const float *x, const float *y)
Returns sqrt(x**2+y**2), taking care not to cause unnecessary overflow.
AA_API void dlarnv_(const int *IDIST, int ISEED[4], const int *N, double *X)
Returns a vector of n random real numbers from a uniform or normal distribution.
static int aa_cla_ilaenv(int ispec, const char *name, const char *opts, int n1, int n2, int n3, int n4)
ILAENV is called from the LAPACK routines to choose problem-dependent parameters for the local enviro...
AA_API float slapy3_(const float *x, const float *y, const float *z)
Returns sqrt(x**2+y**2+z**2), taking care not to cause unnecessary overflow.
static int aa_cla_dgetri(int n, double *A, int lda, int *ipiv, double *work, int lwork)
Invert matrix.
AA_API void sgelsd_(const int *M, const int *N, const int *NRHS, float *A, const int *LDA, float *B, const int *LDB, float *S, const float *RCOND, int *RANK, float *WORK, int *LWORK, int *IWORK, int *INFO)
DGELSD computes the minimum-norm solution to a real linear least squares problem. ...
static float aa_cla_slapy2(float x, float y)
Norm-2.
AA_API void sgetrf_(const int *M, const int *N, float *A, const int *LDA, int *IPIV, int *INFO)
Computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchange...
AA_API void dorgqr_(const int *M, const int *N, const int *K, double *A, const int *LDA, const double *TAU, double *WORK, const int *LWORK, int *INFO)
Generates an M-by-N real matrix Q with orthonormal columns, which is defined as the first N columns o...
static void aa_cla_slaruv(int iseed[4], int n, float *X)
Uniform random vector.
static void aa_cla_dlaset(char UPLO, int M, int N, double ALPHA, double BETA, double *A, int LDA)
Set values in a matrix.
AA_API void dlaruv_(int ISEED[4], const int *N, double *X)
Returns a vector of n random real numbers from a uniform (0,1) distribution (n <= 128)...
AA_API void dgelsd_(const int *M, const int *N, const int *NRHS, double *A, const int *LDA, double *B, const int *LDB, double *S, const double *RCOND, int *RANK, double *WORK, int *LWORK, int *IWORK, int *INFO)
DGELSD computes the minimum-norm solution to a real linear least squares problem. ...
static int aa_cla_dlag2s(int M, int N, double *A, int LDA, float *SA, int LDSA)
Convert double to single float.
AA_API void slag2d_(const int *M, const int *N, float *SA, const int *LDSA, double *A, const int *LDA, const int *INFO)
Converts a SINGLE PRECISION matrix, SA, to a DOUBLE PRECISION matrix, A.
#define AA_MAX(a, b)
maximum of a and b
static int aa_cla_dgeqrf(int m, int n, double *A, int lda, double *tau, double *work, int lwork)
Row Factor.
static double aa_cla_dlapy2(double x, double y)
Norm-2.
static int aa_cla_dgelsd_miniwork(int m, int n)
Minimum iwork for xgelsd.
AA_API int ilaenv_(const int *ispec, const char *name, const char *opts, const int *n1, const int *n2, const int *n3, const int *n4, int name_length, int opts_length)
ILAENV is called from the LAPACK routines to choose problem-dependent parameters for the local enviro...
AA_API void slaruv_(int ISEED[4], const int *N, float *X)
Returns a vector of n random real numbers from a uniform (0,1) distribution (n <= 128)...
static double aa_cla_dlapy3(double x, double y, double z)
Norm-2.
AA_API void slarnv_(const int *IDIST, int ISEED[4], const int *N, float *X)
Returns a vector of n random real numbers from a uniform or normal distribution.
static int aa_cla_sgetri(int n, float *A, int lda, int *ipiv, float *work, int lwork)
Invert matrix.
AA_API void dlaset_(const char UPLO[1], const int *M, const int *N, const double *ALPHA, const double *BETA, double *A, const int *LDA)
initializes an m-by-n matrix A to BETA on the diagonal and ALPHA on the offdiagonals.
static int aa_cla_slag2s(int M, int N, double *A, int LDA, float *SA, int LDSA)
Convert double to single float.
AA_API void slaset_(const char UPLO[1], const int *M, const int *N, const float *ALPHA, const float *BETA, float *A, const int *LDA)
initializes an m-by-n matrix A to BETA on the diagonal and ALPHA on the offdiagonals.
static int aa_cla_sgelsd_miniwork(int m, int n)
Minimum iwork for xgelsd.
AA_API void sgeqrf_(const int *M, const int *N, float *A, const int *LDA, float *TAU, float *WORK, int *LWORK, int *INFO)
DGEQRF computes a QR factorization of a real M-by-N matrix A: A = Q * R.
static int aa_cla_sgelsd_nlvl(int m, int n)
part of worksize computation for xgelsd
AA_API void dlag2s_(const int *M, const int *N, double *A, const int *LDA, float *SA, const int *LDSA, const int *INFO)
Converts a DOUBLE PRECISION matrix, SA, to a SINGLE PRECISION matrix, A.
AA_API void dlascl_(const char TYPE[1], const int *KL, const int *KU, const double *CFROM, const double *CTO, const int *M, const int *N, double *A, const int *LDA, int *INFO)
Multiplies the M by N real matrix A by the real scalar CTO/CFROM.
static int aa_cla_dgelsd_smlsiz()
part of worksize computation for xgelsd
static int aa_cla_dlascl(char TYPE, int KL, int KU, double CFROM, double CTO, int M, int N, double *A, int LDA)
Scale matrix.
static void aa_cla_dlarnv(int idist, int iseed[4], int n, double *X)
Normal random vector.
AA_API void dgeqrf_(const int *M, const int *N, double *A, const int *LDA, double *TAU, double *WORK, int *LWORK, int *INFO)
DGEQRF computes a QR factorization of a real M-by-N matrix A: A = Q * R.
static int aa_cla_sgelsd(int m, int n, int nrhs, float *A, int lda, float *B, int ldb, float *S, float *rcond, int *rank, float *work, int lwork, int *iwork)
Linear least squares.
static int aa_cla_sgetrf(int m, int n, float *A, int lda, int *ipiv)
Row Factor.
static void aa_cla_slaset(char UPLO, int M, int N, float ALPHA, float BETA, float *A, int LDA)
Set values in a matrix.
static void aa_cla_dlacpy(char uplo, int m, int n, const double *A, int lda, double *B, int ldb)
Matrix copy.
AA_API void sorgqr_(const int *M, const int *N, const int *K, float *A, const int *LDA, const float *TAU, float *WORK, const int *LWORK, int *INFO)
Generates an M-by-N real matrix Q with orthonormal columns, which is defined as the first N columns o...
static int aa_cla_dgelsd(int m, int n, int nrhs, double *A, int lda, double *B, int ldb, double *S, double *rcond, int *rank, double *work, int lwork, int *iwork)
Linear least squares.
static void aa_cla_slarnv(int idist, int iseed[4], int n, float *X)
Normal random vector.
AA_API void slacpy_(const char UPLO[1], const int *M, const int *N, const float *A, const int *LDA, float *B, const int *LDB)
Copies all or part of a two-dimensional matrix A to another matrix B.
static int aa_cla_dgetrf(int m, int n, double *A, int lda, int *ipiv)
Row Factor.
static int aa_cla_slag2d(int M, int N, float *SA, int LDSA, double *A, int LDA)
Convert single to double float.
static int aa_cla_dlag2d(int M, int N, float *SA, int LDSA, double *A, int LDA)
Convert single to double float.
AA_API void dlacpy_(const char UPLO[1], const int *M, const int *N, const double *A, const int *LDA, double *B, const int *LDB)
Copies all or part of a two-dimensional matrix A to another matrix B.
static float aa_cla_slapy3(float x, float y, float z)
Norm-2.
static int aa_cla_dgelsd_nlvl(int m, int n)
part of worksize computation for xgelsd
AA_API double dlapy2_(const double *x, const double *y)
Returns sqrt(x**2+y**2), taking care not to cause unnecessary overflow.
AA_API double dlapy3_(const double *x, const double *y, const double *z)
Returns sqrt(x**2+y**2+z**2), taking care not to cause unnecessary overflow.
static int aa_cla_sgelsd_smlsiz()
part of worksize computation for xgelsd
static int aa_cla_slascl(char TYPE, int KL, int KU, float CFROM, float CTO, int M, int N, float *A, int LDA)
Scale matrix.