blas.h 3.74 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 16 17
//  BLAS Header file
//
////////////////////////////////////////////////////////////////////////////////
Francois Gygi committed
18
// $Id: blas.h,v 1.9 2009-03-08 01:16:33 fgygi Exp $
Francois Gygi committed
19 20 21 22 23 24 25 26 27

#ifndef BLAS_H
#define BLAS_H

#include <complex>

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

Francois Gygi committed
28
#ifdef ADD_
29 30 31 32 33 34 35 36 37 38 39 40 41
#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
42
#define dsysv  dsysv_
43 44 45 46 47 48 49
#define zdscal zdscal_
#define idamax idamax_
#define dvea   dvea_
#define dyax   dyax_
#define dnaxpy dnaxpy_
#define dger   dger_
#define zgemm  zgemm_
Francois Gygi committed
50 51 52 53 54 55
#endif

#ifdef __cplusplus
FTN_LINK {
#endif

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

Francois Gygi committed
78
void dger(int *,int *, double *, double *, int *,
Francois Gygi committed
79
  double *, int *, double *, int *);
Francois Gygi committed
80 81 82 83
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*);
84

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

Francois Gygi committed
105 106 107
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*);
108

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

Francois Gygi committed
113
#endif