00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _LAPACK_H__
00015 #define _LAPACK_H__
00016
00017 #include "lib/config.h"
00018 #include "lib/common.h"
00019
00020 #ifdef HAVE_LAPACK
00021
00022 extern "C" {
00023
00024 #ifdef HAVE_MKL
00025 #include <mkl_cblas.h>
00026 #include <mkl_lapack.h>
00027 #else
00028 #include <cblas.h>
00029 #endif
00030
00031 #ifdef HAVE_ACML
00032 #include <acml.h>
00033 #endif
00034
00035 #ifdef HAVE_ATLAS
00036 #include <clapack.h>
00037 #else
00038
00039 int clapack_dpotrf(const CBLAS_ORDER Order, const CBLAS_UPLO Uplo,
00040 const int N, double *A, const int lda);
00041 int clapack_dposv(const CBLAS_ORDER Order, const CBLAS_UPLO Uplo,
00042 const int N, const int NRHS, double *A, const int lda,
00043 double *B, const int ldb);
00044 #endif
00045
00046 namespace shogun
00047 {
00048 void wrap_dsyev(char jobz, char uplo, int n, double *a, int lda,
00049 double *w, int *info);
00050 void wrap_dgesvd(char jobu, char jobvt, int m, int n, double *a, int lda,
00051 double *sing, double *u, int ldu, double *vt, int ldvt,
00052 int *info);
00053 }
00054
00055
00056 #if !defined(HAVE_ACML) && !defined(HAVE_MKL)
00057 int dsyev_(char*, char*, int*, double*, int*, double*, double*, int*, int*);
00058 int dgesvd_(char* jobu, char* jobvt, int* m, int* n, double* a, int* lda,
00059 double* s, double* u, int* ldu, double* vt, int* ldvt, double* work,
00060 int* lwork, int* info);
00061 int dposv_(const char *uplo, const int *n, const int *nrhs, double *a, const int *lda, double *b, const int *ldb, int *info);
00062 int dpotrf_(const char *uplo, int *n, double *a, int * lda, int *info);
00063 #endif
00064 }
00065
00066 #endif //HAVE_LAPACK
00067 #endif //_LAPACK_H__