blas.h 3.7 KB
Newer Older
Francois Gygi committed
1 2
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
3 4 5 6
// Copyright (c) 2008 The Regents of the University of California
//
// This file is part of Qbox
//
Francois Gygi committed
7 8
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
Francois Gygi committed
9 10 11 12 13 14
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
15
// blas.h
Francois Gygi committed
16 17
//
////////////////////////////////////////////////////////////////////////////////
Francois Gygi committed
18 19
//
// BLAS Header file
Francois Gygi committed
20 21 22 23 24 25 26 27 28

#ifndef BLAS_H
#define BLAS_H

#include <complex>

// default value for most compilers
#define FTN_LINK extern "C"

Francois Gygi committed
29
#ifdef ADD_
30 31 32 33 34 35 36 37 38 39 40 41 42
#define dcopy  dcopy_
#define zcopy  zcopy_
#define daxpy  daxpy_
#define ddot   ddot_
#define dnrm2  dnrm2_
#define drot   drot_
#define dasum  dasum_
#define dsbmv  dsbmv_
#define dgemm  dgemm_
#define dgesv  dgesv_
#define dgemv  dgemv_
#define dscal  dscal_
#define dsyev  dsyev_
Francois Gygi committed
43
#define dsysv  dsysv_
44 45 46 47 48 49 50
#define zdscal zdscal_
#define idamax idamax_
#define dvea   dvea_
#define dyax   dyax_
#define dnaxpy dnaxpy_
#define dger   dger_
#define zgemm  zgemm_
Francois Gygi committed
51 52 53 54 55 56
#endif

#ifdef __cplusplus
FTN_LINK {
#endif

57
void dcopy(int *n, double *x, int *incx,
Francois Gygi committed
58
  double *y, int *incy );
59
void zcopy(int *n, std::complex<double> *x, int *incx,
Francois Gygi committed
60
  std::complex<double> *y, int *incy );
Francois Gygi committed
61
void daxpy(int *n, double *alpha, double *x, int *incx,
Francois Gygi committed
62
  double *y, int *incy );
63
double ddot(const int *n, const double *a, const int *inca,
Francois Gygi committed
64
  const double *b, const int *incb);
65
double dnrm2(const int *n, const double *a, const int *inca);
Francois Gygi committed
66 67
void drot(int*, double*, int*, double*, int*, double*, double*);
void dgemm(char *ta, char *tb, int *m, int *n, int *k,
Francois Gygi committed
68 69 70
  double *alpha, double *a, int *lda, double *b, int *ldb,
  double *beta, double *c, int *ldc);
void zgemm(char *ta, char *tb, int *m, int *n, int *k,
71
  std::complex<double> *alpha, std::complex<double> *a, int *lda,
Francois Gygi committed
72 73
  std::complex<double> *b, int *ldb,
  std::complex<double> *beta, std::complex<double> *c, int *ldc);
Francois Gygi committed
74
void dgemv( char *ta, int *m, int *n,
Francois Gygi committed
75 76 77
  double *alpha,  double *a, int *tda,
  double *x,    int *incx,
  double *beta,   double *y, int *incy );
78

Francois Gygi committed
79
void dger(int *,int *, double *, double *, int *,
Francois Gygi committed
80
  double *, int *, double *, int *);
Francois Gygi committed
81 82 83 84
void zgeru(int*,int*,std::complex<double>*,std::complex<double>*,int*,
  std::complex<double>*,int*,std::complex<double>*,int*);
void zgerc(int*,int*,std::complex<double>*,std::complex<double>*,int*,
  std::complex<double>*,int*,std::complex<double>*,int*);
85

Francois Gygi committed
86
void dscal(int *len, double *alpha, double *x, int *incx);
Francois Gygi committed
87 88
  double dasum(int *len, double *x, int *incx);
  int idamax(int *len, double *x, int *incx);
89
void dsyev(char *c1,char *c2,int *n,
Francois Gygi committed
90 91 92
  double *a,int *lda, double *wr,
  double *wrk,int *lwrk, int *ierr);
void dsysv(char*,int*,int*,double*,int*,int*,double*,int*,double*,int*,int*);
93
void zdscal_(int *n,double *alpha,std::complex<double> *x,int *incx);
Francois Gygi committed
94
void dgbmv(char *trans, int *m, int *n,
Francois Gygi committed
95 96 97
  int *kl, int *ku, double *alpha, double *a,
  int *lda, double *x, int *incx, double *beta,
  double *y, int *incy);
Francois Gygi committed
98
void dsbmv(char *uplo, int *n, int *k,
Francois Gygi committed
99 100
  double *alpha, double *a, int *lda, double *x, int *incx,
  double *beta, double *y, int *incy);
Francois Gygi committed
101
void sspev(char *vec,char *uplo,int *size,double *ap,
Francois Gygi committed
102
  double *wr,double *z,int *n,double *wrk,int *ierr);
103
void dgesv(int *n, int *nrhs, double *a, int *lda, int *ipiv,
Francois Gygi committed
104
  double *b, int *ldb, int *info);
105

Francois Gygi committed
106 107 108
void dvea(int*,double*,int*,double*,int*,double*,int*);
void dyax(int*,double*,double*,int*,double*,int*);
void dnaxpy(int*,int*,double*,int*,double*,int*,int*,double*,int*,int*);
109

Francois Gygi committed
110 111 112
#ifdef __cplusplus
}
#endif
113

Francois Gygi committed
114
#endif