00001
00029 #ifndef LAPACK_H
00030 #define LAPACK_H
00031
00032 #ifndef _MSC_VER
00033 # include <itpp/config.h>
00034 #else
00035 # include <itpp/config_msvc.h>
00036 #endif
00037
00038 #include <complex>
00039
00040 extern "C"
00041 {
00042
00043
00044
00045 #ifdef HAVE_MKL // Note: HAVE_MKL is hard-defined in <itpp/config_msvc.h>
00046
00047 #define dgetrf_ dgetrf
00048 #define zgetrf_ zgetrf
00049
00050 #define dgetri_ dgetri
00051 #define zgetri_ zgetri
00052
00053 #define dgesvd_ dgesvd
00054 #define zgesvd_ zgesvd
00055
00056 #define dsyev_ dsyev
00057 #define zheev_ zheev
00058
00059 #define dgeev_ dgeev
00060 #define zgeev_ zgeev
00061
00062 #define dpotrf_ dpotrf
00063 #define zpotrf_ zpotrf
00064
00065 #define dgeqrf_ dgeqrf
00066 #define zgeqrf_ zgeqrf
00067
00068 #define dgeqp3_ dgeqp3
00069 #define zgeqp3_ zgeqp3
00070
00071 #define dorgqr_ dorgqr
00072 #define zungqr_ zungqr
00073
00074 #define dormqr_ dormqr
00075 #define zunmqr_ zunmqr
00076
00077 #define dgesv_ dgesv
00078 #define zgesv_ zgesv
00079
00080 #define dposv_ dposv
00081 #define zposv_ zposv
00082
00083 #define dtrtrs_ dtrtrs
00084 #define ztrtrs_ ztrtrs
00085
00086 #define dgels_ dgels
00087 #define zgels_ zgels
00088
00089 #define dgees_ dgees
00090 #define zgees_ zgees
00091
00092 #endif // #ifdef HAVE_MKL
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102 void dgetrf_(int *m, int *n, double *a, int *lda, int *ipiv, int *info);
00103 void zgetrf_(int *m, int *n, std::complex<double> *a, int *lda, int *ipiv,
00104 int *info);
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 void dgetri_(int *n, double *a, int *lda, int *ipiv, double *work, int *lwork,
00117 int *info);
00118 void zgetri_(int *n, std::complex<double> *a, int *lda, int *ipiv,
00119 std::complex<double> *work, int *lwork, int *info);
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 void dgesvd_(char *jobu, char *jobvt, int *m, int *n, double *a, int *lda,
00140 double *s, double *u, int *ldu, double *vt, int *ldvt,
00141 double *work, int *lwork, int *info);
00142 void zgesvd_(char *jobu, char *jobvt, int *m, int *n, std::complex<double> *a,
00143 int *lda, double *s, std::complex<double> *u, int *ldu,
00144 std::complex<double> *vt, int *ldvt, std::complex<double> *work,
00145 int *lwork, double *rwork, int *info);
00146
00147
00148 void dsyev_(char *jobz, char *uplo, int *n, double *a, int *lda, double *w,
00149 double *work, int *lwork, int *info);
00150 void zheev_(char *jobz, char *uplo, int *n, std::complex<double> *a, int *lda,
00151 double *w, std::complex<double> *work, int *lwork, double *rwork,
00152 int *info);
00153
00154
00155 void dgeev_(char *jobvl, char *jobvr, int *n, double *a, int *lda, double *wr,
00156 double *wi, double *vl, int *ldvl, double *vr, int *ldvr,
00157 double *work, int *lwork, int *info);
00158 void zgeev_(char *jobvl, char *jobvr, int *n, std::complex<double> *a,
00159 int *lda, std::complex<double> *w, std::complex<double> *vl,
00160 int *ldvl, std::complex<double> *vr, int *ldvr,
00161 std::complex<double> *work, int *lwork, double *rwork, int *info);
00162
00163
00164
00165 void dpotrf_(char *uplo, int *n, double *a, int *lda, int *info);
00166 void zpotrf_(char *uplo, int *n, std::complex<double> *a, int *lda,
00167 int *info);
00168
00169
00170 void dgeqrf_(int *m, int *n, double *a, int *lda, double *tau, double *work,
00171 int *lwork, int *info);
00172 void zgeqrf_(int *m, int *n, std::complex<double> *a, int *lda,
00173 std::complex<double> *tau, std::complex<double> *work,
00174 int *lwork, int *info);
00175
00176
00177 void dgeqp3_(int *m, int *n, double *a, int *lda, int *jpvt, double *tau,
00178 double *work, int *lwork, int *info);
00179 void zgeqp3_(int *m, int *n, std::complex<double> *a, int *lda, int *jpvt,
00180 std::complex<double> *tau, std::complex<double> *work,
00181 int *lwork, double *rwork, int *info);
00182
00183
00184 void dorgqr_(int *m, int *n, int *k, double *a, int *lda, double *tau,
00185 double *work, int *lwork, int *info);
00186 void zungqr_(int *m, int *n, int *k, std::complex<double> *a, int *lda,
00187 std::complex<double> *tau, std::complex<double> *work,
00188 int *lwork, int *info);
00189
00190
00191
00192
00193
00194 void dormqr_(char *side, char *trans, int *m, int *n, int *k, double *a,
00195 int *lda, double *tau, double *c, int *ldc, double *work,
00196 int *lwork, int *info);
00197
00198
00199
00200
00201 void zunmqr_(char *side, char *trans, int *m, int *n, int *k,
00202 std::complex<double> *a, int *lda, std::complex<double> *tau,
00203 std::complex<double> *c, int *ldc, std::complex<double> *work,
00204 int *lwork, int *info);
00205
00206
00207
00208
00209
00210
00211 void dgesv_(int *n, int *nrhs, double *a, int *lda, int *ipiv, double *b,
00212 int *ldb, int *info);
00213 void zgesv_(int *n, int *nrhs, std::complex<double> *a, int *lda, int *ipiv,
00214 std::complex<double> *b, int *ldb, int *info);
00215
00216
00217
00218
00219
00220
00221
00222 void dposv_(char *uplo, int *n, int *nrhs, double *a, int *lda, double *b,
00223 int *ldb, int *info);
00224 void zposv_(char *uplo, int *n, int *nrhs, std::complex<double> *a, int *lda,
00225 std::complex<double> *b, int *ldb, int *info);
00226
00227
00228
00229
00230
00231 void dtrtrs_(char *uplo, char *trans, char *diag, int *n, int *nrhs,
00232 double *a, int *lda, double *b, int *ldb, int *info);
00233 void ztrtrs_(char *uplo, char *trans, char *diag, int *n, int *nrhs,
00234 std::complex<double> *a, int *lda, std::complex<double> *b,
00235 int *ldb, int *info);
00236
00237
00238
00239
00240
00241 void dgels_(char *trans, int *m, int *n, int *nrhs, double *a, int *lda,
00242 double *b, int *ldb, double *work, int *lwork, int *info);
00243 void zgels_(char *trans, int *m, int *n, int *nrhs, std::complex<double> *a,
00244 int *lda, std::complex<double> *b, int *ldb,
00245 std::complex<double> *work, int *lwork, int *info);
00246
00247
00248
00249
00250
00251 void dgees_(char *jobvs, char *sort, int* select, int *n, double *a,
00252 int *lda, int *sdim, double *wr, double *wi, double *vs,
00253 int *ldvs, double *work, int *lwork, int *bwork, int *info);
00254
00255
00256
00257
00258
00259 void zgees_(char *jobvs, char *sort, int* select, int *n,
00260 std::complex<double> *a, int *lda, int *sdim,
00261 std::complex<double> *w, std::complex<double> *vs, int *ldvs,
00262 std::complex<double> *work, int *lwork, double *rwork,
00263 int *bwork, int *info);
00264
00265 }
00266
00267 #endif // #ifndef LAPACK_H