00001
00005
00006 #ifdef CLAPACK
00007 #include "blaswrap.h"
00008 #endif
00009
00010 #ifdef __cplusplus
00011 extern "C" {
00012 #endif
00013
00014 static __inline void daxpy(int n,double da,double *dx,int incx,double *dy,
00015 int incy)
00016 {
00017 void daxpy_(int *,double *,double *,int *,double *,int *);
00018
00019 daxpy_(&n,&da,dx,&incx,dy,&incy);
00020 }
00021
00022 static __inline void dcopy(int n,double *dx,int incx,double *dy,int incy)
00023 {
00024 void dcopy_(int *,double *,int *, double *,int *);
00025
00026 dcopy_(&n,dx,&incx,dy,&incy);
00027 }
00028
00029 static __inline double ddot(int n,double *dx,int incx,double *dy,int incy)
00030 {
00031 double ddot_(int *,double *,int *,double *,int *);
00032
00033 return ddot_(&n,dx,&incx,dy,&incy);
00034 }
00035
00036 static __inline void dgels(char *trans,int m,int n,int nrhs,double *a,
00037 int lda,double *b,int ldb,double *work,
00038 int lwork,int *info)
00039 {
00040 void dgels_(char *,int *,int *,int *,double *,int *,double *,int *,double *,
00041 int *,int *);
00042
00043 dgels_(trans,&m,&n,&nrhs,a,&lda,b,&ldb,work,&lwork,info);
00044 }
00045
00046 static __inline void dgemm(char *transa,char *transb,int m,int n,int k,
00047 double alpha,double *a,int lda,double *b,int ldb,
00048 double beta,double *c,int ldc)
00049 {
00050 void dgemm_(char *,char *,int *,int *, int *,double *,double *,int *,
00051 double *,int *,double *,double *,int *);
00052
00053 dgemm_(transa,transb,&m,&n,&k,&alpha,a,&lda,b,&ldb,&beta,c,&ldc);
00054 }
00055
00056
00057 static __inline void dgemv(char *trans,int m,int n,double alpha,
00058 double *a,int lda,double *dx,int incx,
00059 double beta,double *dy,int incy)
00060 {
00061 void dgemv_(char *,int *,int *,double *,double *,int *,double *,
00062 int *,double *,double *,int *);
00063
00064 dgemv_(trans,&m,&n,&alpha,a,&lda,dx,&incx,&beta,dy,&incy);
00065 }
00066
00067
00068 static __inline void dgesv(int n, int nrhs, double *a, int lda, int *ipiv,
00069 double *b, int ldb, int *info)
00070 {
00071
00072 void dgesv_(int *,int *,double *,int *,int *,double *,int *,int *);
00073
00074 dgesv_(&n,&nrhs,a,&lda,ipiv,b,&ldb,info);
00075 }
00076
00077 static __inline void dgelss(int m, int n, int nrhs, double *a, int lda, double *b, int ldb,
00078 double *s, double rcond, int *rank,
00079 double *work, int lwork, int *info)
00080 {
00081 void dgelss_(int *, int *, int *, double *, int *, double *, int *,
00082 double *, double *, int *,
00083 double *, int *, int *);
00084 dgelss_(&m, &n, &nrhs, a, &lda, b, &ldb,
00085 s, &rcond, rank,
00086 work, &lwork, info);
00087 }
00088
00089
00090 static __inline void dgesvd(char *jobu,char *jobvt, int m, int n, double *a,
00091 int lda, double *s, double *u, int ldu, double *vt,
00092 int ldvt,double *work, int lwork, int *info)
00093 {
00094
00095 void dgesvd_(char *,char *,int *,int *,double *,int *,double *,double *,
00096 int *,double *,int *,double *,int *,int *);
00097
00098 dgesvd_(jobu,jobvt,&m,&n,a,&lda,s,u,&ldu,vt,&ldvt,work,&lwork,info);
00099 }
00100
00101
00102
00103 static __inline void dgetrf(int m,int n,double *a,int lda,int *ipiv,int *info)
00104 {
00105 void dgetrf_(int *,int *,double *,int *,int *,int *);
00106
00107 dgetrf_(&m,&n,a,&lda,ipiv,info);
00108 }
00109
00110
00111
00112 static __inline void dgetri(int n,double *a,int lda,int *ipiv,double *work,
00113 int lwork,int *info)
00114 {
00115 void dgetri_(int *,double *,int *,int *,double *,int *,int *);
00116
00117 dgetri_(&n,a,&lda,ipiv,work,&lwork,info);
00118 }
00119
00120
00121
00122 static __inline void dlascl(char *type,int kl,int ku,double from,double to,
00123 int m,int n,double *a,int lda,int *info)
00124 {
00125 void dlascl_(char *,int *,int *,double *,double *, int *,
00126 int *, double *,int *,int *);
00127
00128 dlascl_(type,&kl,&ku,&from,&to,&m,&n,a,&lda,info);
00129 }
00130
00131
00132
00133 static __inline double dnrm2(int n,double *dx,int incx)
00134 {
00135 double dnrm2_(int *,double *,int *);
00136
00137 return dnrm2_(&n,dx,&incx);
00138 }
00139
00140
00141
00142 static __inline void dpptrf(char *uplo,int n,double *ap,int *info)
00143 {
00144 void dpptrf_(char *,int *,double *,int *);
00145
00146 dpptrf_(uplo,&n,ap,info);
00147 }
00148
00149
00150 static __inline void dscal(int n,double da,double *dx,int incx)
00151 {
00152 void dscal_(int *,double *,double *,int *);
00153
00154 dscal_(&n,&da,dx,&incx);
00155 }
00156
00157 static __inline void dspgst(int itype,char *uplo,int n,double *ap,
00158 double *bp,int *info)
00159 {
00160 void dspgst_(int *,char *,int *,double *,double *,int *);
00161
00162 dspgst_(&itype,uplo,&n,ap,bp,info);
00163 }
00164
00165
00166
00167 static __inline void dspev(char *jobz,char *uplo, int n, double *ap,
00168 double *w, double *z, int ldz, double *work,
00169 int *info)
00170 {
00171 void dspev_(char *,char *,int *,double *,double *,double *,int *,double *,
00172 int *);
00173
00174 dspev_(jobz,uplo,&n,ap,w,z,&ldz,work,info);
00175 }
00176
00177
00178
00179 static __inline void dspgv(int itype,char *jobz,char *uplo, int n, double *ap,
00180 double *bp, double *w,double *z, int ldz,
00181 double *work,int *info)
00182 {
00183 void dspgv_(int *,char *,char *,int *,double *,double *,double *,double *,
00184 int *,double *,int *);
00185
00186 dspgv_(&itype,jobz,uplo,&n,ap,bp,w,z,&ldz,work,info);
00187 }
00188
00189
00190
00191 static __inline void dtptri(char *uplo,char *diag,int n,double *ap,int *info)
00192 {
00193 void dtptri_(char *,char *,int *,double *,int *);
00194
00195 dtptri_(uplo,diag,&n,ap,info);
00196 }
00197
00198
00199 static __inline void dtrcon(char *norm,char *uplo,char *diag,int n,double *a,
00200 int lda,double *rcond,double *work,int *iwork,
00201 int *info)
00202 {
00203 void dtrcon_(char *,char *,char *,int *,double *,int *,double *,double *,
00204 int *,int *);
00205
00206 dtrcon_(norm,uplo,diag,&n,a,&lda,rcond,work,iwork,info);
00207 }
00208
00209 static __inline void dgeqp3(int m, int n, double *a, int lda, int *jpvt,
00210 double *tau, double *work, int lwork, int *info)
00211 {
00212 void dgeqp3_(int*, int*, double*, int*, int*, double*, double*, int*, int*);
00213 dgeqp3_(&m, &n, a, &lda, jpvt, tau, work, &lwork, info);
00214 }
00215
00216 static __inline void dtrtrs(char *uplo, char *trans, char *diag, int n,
00217 int nrhs, double *a, int lda, double *b, int ldb,
00218 int *info)
00219 {
00220 void dtrtrs_(char*, char*, char*, int*, int*, double*, int*, double*, int*, int*);
00221 dtrtrs_(uplo, trans, diag, &n, &nrhs, a, &lda, b, &ldb, info);
00222 }
00223
00224 static __inline void dorgqr(int m, int n, int k, double *a, int lda, double *tau,
00225 double *work, int lwork, int *info)
00226 {
00227 void dorgqr_(int*, int*, int*, double*, int*, double*, double*, int*, int*);
00228 dorgqr_(&m, &n, &k, a, &lda, tau, work, &lwork, info);
00229 }
00230
00231
00232 #ifdef __cplusplus
00233 }
00234 #endif