00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00030 #ifndef SCYTHE_LAPACK_H
00031 #define SCYTHE_LAPACK_H
00032
00033 #ifdef SCYTHE_COMPILE_DIRECT
00034 #endif
00035
00036 namespace scythe {
00037
00038 namespace lapack {
00039 inline void
00040 make_symmetric(double* matrix, int rows)
00041 {
00042 for (int i = 1; i < rows; ++i)
00043 for (int j = 0; j < i; ++j)
00044 matrix[i * rows + j] = matrix[j * rows + i];
00045 }
00046
00047 extern "C" {
00048
00049
00050 void dgemm_ (char* transa, char* transb, const int* m,
00051 const int* n, const int* k, const double* alpha,
00052 const double* a, const int* lda, const double* b,
00053 const int* ldb, const double* beta, double* c,
00054 const int* ldc);
00055
00056
00057 void dsyrk_(const char* uplo, const char* trans, const int* n,
00058 const int* k, const double* alpha, const double* a,
00059 const int* lda, const double* beta, double* c,
00060 const int* ldc);
00061
00062
00063 void dgetrf_ (const int* rows, const int* cols, double* a,
00064 const int* lda, int* ipiv, int *info);
00065
00066
00067 void dgetri_ (const int* n, double* a, const int* lda,
00068 const int* ipiv, double* work, const int* lwork,
00069 int* info);
00070
00071
00072 void dpotrf_(const char* uplo, const int* n, double* a,
00073 const int* lda, int* info);
00074
00075
00076 void dpotrs_ (const char* uplo, const int* n, const int* nrhs,
00077 const double* a, const int* lda, double *b,
00078 const int* ldb, int* info);
00079
00080
00081 void dposv_ (const char* uplo, const int* n, const int* nrhs,
00082 double* a, const int* lda, double* b, const int* ldb,
00083 int* info);
00084
00085
00086 void dpotri_(const char* uplo, const int* n, double* a,
00087 const int* lda, int* info);
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 void dsyevr_ (const char* jobz, const char* range, const char* uplo,
00098 const int* n, double* a, const int* lda, double* vl,
00099 double* vu, const int* il, const int* iu,
00100 const double* abstol, const int* m, double* w,
00101 double* z, const int* ldz, int* isuppz, double*
00102 work, int* lwork, int* iwork, const int* liwork,
00103 int* info);
00104
00105
00106 void dgeqp3_ (const int* m, const int* n, double* a, const int* lda,
00107 int* jpvt, double* tau, double* work, const int* lwork,
00108 int* info);
00109
00110
00111 void dormqr_ (const char* side, const char* trans, const int* m,
00112 const int* n, const int* k, const double* a,
00113 const int* lda, const double* tau, double* c,
00114 const int* ldc, double* work, const int* lwork,
00115 int* info);
00116
00117 void dtrtrs_ (const char* uplo, const char* trans, const char* diag,
00118 const int* n, const int* nrhs, const double* a,
00119 const int* lda, double* b, const int* ldb, int* info);
00120
00121
00122 void dgesdd_ (const char* jobz, const int* m, const int* n, double* a,
00123 const int* lda, double* s, double* u, const int* ldu,
00124 double* vt, const int* ldvt, double* work,
00125 const int* lwork, int* iwork, int* info);
00126
00127 }
00128 }
00129 }
00130
00131 #endif