27 #if defined(HAVE_MKL) || defined(HAVE_ACML)
44 #define DGESVD dgesvd_
46 #define DPOTRF dpotrf_
47 #define DPOTRI dpotri_
48 #define DGETRI dgetri_
49 #define DGETRF dgetrf_
50 #define DGEQRF dgeqrf_
51 #define DORGQR dorgqr_
52 #define DSYEVR dsyevr_
53 #define DGETRS dgetrs_
54 #define DPOTRS dpotrs_
55 #define DSYGVX dsygvx_
56 #define DSTEMR dstemr_
60 int clapack_dpotrf(
const CBLAS_ORDER Order,
const CBLAS_UPLO Uplo,
61 const int N,
double *A,
const int LDA)
65 if (Order==CblasRowMajor)
70 else if (Uplo==CblasLower)
75 DPOTRF(uplo, N, A, LDA, &info);
79 DPOTRF(&uplo, &n, A, &lda, &info);
85 int clapack_dpotri(
const CBLAS_ORDER Order,
const CBLAS_UPLO Uplo,
86 const int N,
double *A,
const int LDA)
90 if (Order==CblasRowMajor)
95 else if (Uplo==CblasLower)
100 DPOTRI(uplo, N, A, LDA, &info);
104 DPOTRI(&uplo, &n, A, &lda, &info);
115 int clapack_dposv(
const CBLAS_ORDER Order,
const CBLAS_UPLO Uplo,
116 const int N,
const int NRHS,
double *A,
const int lda,
117 double *B,
const int ldb)
121 if (Order==CblasRowMajor)
123 if (Uplo==CblasUpper)
126 else if (Uplo==CblasLower)
131 DPOSV(uplo,N,NRHS,A,lda,B,ldb,&info);
137 DPOSV(&uplo, &n, &nrhs, A, &LDA, B, &LDB, &info);
143 int clapack_dgetrf(
const CBLAS_ORDER Order,
const int M,
const int N,
144 double *A,
const int lda,
int *ipiv)
149 DGETRF(M,N,A,lda,ipiv,&info);
154 DGETRF(&m,&n,A,&LDA,ipiv,&info);
161 int clapack_dgetri(
const CBLAS_ORDER Order,
const int N,
double *A,
162 const int lda,
int* ipiv)
166 DGETRI(N,A,lda,ipiv,&info);
173 DGETRI(&n,A,&LDA,ipiv,&work1,&lwork,&info);
175 work = SG_MALLOC(
double, lwork);
176 DGETRI(&n,A,&LDA,ipiv,work,&lwork,&info);
184 int clapack_dgetrs(
const CBLAS_ORDER Order,
const CBLAS_TRANSPOSE Transpose,
185 const int N,
const int NRHS,
double *A,
const int lda,
186 int *ipiv,
double *B,
const int ldb)
190 if (Transpose==CblasTrans)
195 DGETRS(trans,N,NRHS,A,lda,ipiv,B,ldb,info);
201 DGETRS(&trans,&n,&nrhs,A,&LDA,ipiv,B,&LDB,&info);
208 int clapack_dpotrs(
const CBLAS_ORDER Order,
const CBLAS_UPLO Uplo,
209 const int N,
const int NRHS,
double *A,
const int lda,
210 double *B,
const int ldb)
214 if (Uplo==CblasLower)
219 DPOTRS(uplo,N,NRHS,A,lda,B,ldb,info);
225 DPOTRS(&uplo,&n,&nrhs,A,&LDA,B,&LDB,&info);
235 void wrap_dsyev(
char jobz,
char uplo,
int n,
double *a,
int lda,
double *w,
int *info)
238 DSYEV(jobz, uplo, n, a, lda, w, info);
242 DSYEV(&jobz, &uplo, &n, a, &lda, w, &work1, &lwork, info);
246 double* work=SG_MALLOC(
double, lwork);
247 DSYEV(&jobz, &uplo, &n, a, &lda, w, work, &lwork, info);
253 void wrap_dgesvd(
char jobu,
char jobvt,
int m,
int n,
double *a,
int lda,
double *sing,
254 double *u,
int ldu,
double *vt,
int ldvt,
int *info)
257 DGESVD(jobu, jobvt, m, n, a, lda, sing, u, ldu, vt, ldvt, info);
261 DGESVD(&jobu, &jobvt, &m, &n, a, &lda, sing, u, &ldu, vt, &ldvt, &work1, &lworka, info);
263 lworka = (int) work1;
264 double* worka = SG_MALLOC(
double, lworka);
265 DGESVD(&jobu, &jobvt, &m, &n, a, &lda, sing, u, &ldu, vt, &ldvt, worka, &lworka, info);
271 void wrap_dgeqrf(
int m,
int n,
double *a,
int lda,
double *tau,
int *info)
274 DGEQRF(m, n, a, lda, tau, info);
278 DGEQRF(&m, &n, a, &lda, tau, &work1, &lwork, info);
282 double* work = SG_MALLOC(
double, lwork);
283 DGEQRF(&m, &n, a, &lda, tau, work, &lwork, info);
289 void wrap_dorgqr(
int m,
int n,
int k,
double *a,
int lda,
double *tau,
int *info)
292 DORGQR(m, n, k, a, lda, tau, info);
296 DORGQR(&m, &n, &k, a, &lda, tau, &work1, &lwork, info);
300 double* work = SG_MALLOC(
double, lwork);
301 DORGQR(&m, &n, &k, a, &lda, tau, work, &lwork, info);
307 void wrap_dsyevr(
char jobz,
char uplo,
int n,
double *a,
int lda,
int il,
int iu,
308 double *eigenvalues,
double *eigenvectors,
int *info)
314 int* isuppz = SG_MALLOC(
int, n);
316 DSYEVR(jobz,I,uplo,n,a,lda,vl,vu,il,iu,abstol,m,
317 eigenvalues,eigenvectors,n,isuppz,info);
323 DSYEVR(&jobz,&I,&uplo,&n,a,&lda,&vl,&vu,&il,&iu,&abstol,
324 &m,eigenvalues,eigenvectors,&n,isuppz,
325 &work1,&lwork,&work2,&liwork,info);
329 double* work = SG_MALLOC(
double, lwork);
330 int* iwork = SG_MALLOC(
int, liwork);
331 DSYEVR(&jobz,&I,&uplo,&n,a,&lda,&vl,&vu,&il,&iu,&abstol,
332 &m,eigenvalues,eigenvectors,&n,isuppz,
333 work,&lwork,iwork,&liwork,info);
342 void wrap_dsygvx(
int itype,
char jobz,
char uplo,
int n,
double *a,
int lda,
double *b,
343 int ldb,
int il,
int iu,
double *eigenvalues,
double *eigenvectors,
int *info)
348 int* ifail = SG_MALLOC(
int, n);
351 DSYGVX(itype,jobz,I,uplo,n,a,lda,b,ldb,vl,vu,
352 il,iu,abstol,m,eigenvalues,
353 eigenvectors,n,ifail,info);
357 int* iwork = SG_MALLOC(
int, 5*n);
358 DSYGVX(&itype,&jobz,&I,&uplo,&n,a,&lda,b,&ldb,&vl,&vu,
359 &il,&iu,&abstol,&m,eigenvalues,eigenvectors,
360 &n,&work1,&lwork,iwork,ifail,info);
362 double* work = SG_MALLOC(
double, lwork);
363 DSYGVX(&itype,&jobz,&I,&uplo,&n,a,&lda,b,&ldb,&vl,&vu,
364 &il,&iu,&abstol,&m,eigenvalues,eigenvectors,
365 &n,work,&lwork,iwork,ifail,info);
373 void wrap_dstemr(
char jobz,
char range,
int n,
double* diag,
double *subdiag,
374 double vl,
double vu,
int il,
int iu,
int* m,
double* w,
double* z__,
375 int ldz,
int nzc,
int *isuppz,
int tryrac,
int *info)
384 DSTEMR(&jobz, &range, &n, diag, subdiag, &vl, &vu,
385 &il, &iu, m, w, z__, &ldz, &nzc, isuppz, &tryrac,
386 &work1, &lwork, &iwork1, &liwork, info);
389 double* work=SG_MALLOC(
double, lwork);
390 int* iwork=SG_MALLOC(
int, liwork);
391 DSTEMR(&jobz, &range, &n, diag, subdiag, &vl, &vu,
392 &il, &iu, m, w, z__, &ldz, &nzc, isuppz, &tryrac,
393 work, &lwork, iwork, &liwork, info);
void wrap_dsyevr(char jobz, char uplo, int n, double *a, int lda, int il, int iu, double *eigenvalues, double *eigenvectors, int *info)
#define SG_SNOTIMPLEMENTED
void wrap_dstemr(char jobz, char range, int n, double *diag, double *subdiag, double vl, double vu, int il, int iu, int *m, double *w, double *z__, int ldz, int nzc, int *isuppz, int tryrac, int *info)
void wrap_dgesvd(char jobu, char jobvt, int m, int n, double *a, int lda, double *sing, double *u, int ldu, double *vt, int ldvt, int *info)
void wrap_dsygvx(int itype, char jobz, char uplo, int n, double *a, int lda, double *b, int ldb, int il, int iu, double *eigenvalues, double *eigenvectors, int *info)
void wrap_dsyev(char jobz, char uplo, int n, double *a, int lda, double *w, int *info)
all of classes and functions are contained in the shogun namespace
void wrap_dgeqrf(int m, int n, double *a, int lda, double *tau, int *info)
void wrap_dorgqr(int m, int n, int k, double *a, int lda, double *tau, int *info)