Psi4
fnocc/blas.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef BLAS_H
29 #define BLAS_H
30 
35 #include "blas_mangle.h"
36 
37 typedef long int integer;
38 typedef double doublereal;
39 
40 namespace psi{ namespace fnocc{
41 
45 void F_DGEMV(char trans,integer m,integer n,doublereal alpha,doublereal*A,integer lda,
46  doublereal*X,integer incx,doublereal beta,doublereal*Y,integer incy);
50 void F_DGEMM(char transa,char transb, integer m, integer n, integer k,
52  doublereal beta,doublereal*C,integer ldc);
53 
57 extern "C" {
58  void dgemv(char&trans,integer&m,integer&n,doublereal&alpha,doublereal*A,integer&lda,
59  doublereal*X,integer&incx,doublereal&beta,doublereal*Y,integer&incy);
60 };
61 inline void DGEMV(char&trans,integer&m,integer&n,doublereal&alpha,doublereal*A,integer&lda,
62  doublereal*X,integer&incx,doublereal&beta,doublereal*Y,integer&incy){
63  dgemv(trans,m,n,alpha,A,lda,X,incx,beta,Y,incy);
64 }
68 extern "C" {
69  void dgemm(char&transa,char&transb,integer&m,integer&n,integer&k,
71  doublereal&beta,doublereal*C,integer&ldc);
72 };
73 inline void DGEMM(char&transa,char&transb,integer&m,integer&n,integer&k,
75  doublereal&beta,doublereal*C,integer&ldc)
76 {
77  dgemm(transa,transb,m,n,k,alpha,A,lda,B,ldb,beta,C,ldc);
78 };
82 extern "C" {
83  void dcopy(integer&n,doublereal*dx,integer&incx,doublereal*dy,
84  integer&incy);
85 };
86 inline void DCOPY(integer&n,doublereal*dx,integer&incx,doublereal*dy,
87  integer&incy){
88  dcopy(n,dx,incx,dy,incy);
89 }
93 extern"C"{
94  double dnrm2(integer&N,doublereal*X,integer&INCX);
95 };
96 inline double DNRM2(integer&N,doublereal*X,integer&INCX){
97  return dnrm2(N,X,INCX);
98 };
102 extern"C" {
103  void dgesv(integer &N,integer &NRHS,doublereal*A,integer &LDA,integer*IPIV,doublereal*B,integer &LDB,integer &INFO);
104 };
105 inline void DGESV(integer &N,integer &NRHS,doublereal*A,integer &LDA,integer*IPIV,doublereal*B,integer &LDB,integer &INFO){
106  dgesv(N,NRHS,A,LDA,IPIV,B,LDB,INFO);
107 };
111 extern "C" {
112  double ddot(integer&n,doublereal*dx,integer&incx,doublereal*dy,integer&incy);
113 };
114 inline double DDOT(integer&n,doublereal*dx,integer&incx,doublereal*dy,integer&incy){
115  return ddot(n,dx,incx,dy,incy);
116 }
117 
118 
126 extern "C" {
127  void dsyev(char&JOBZ,char&UPLO,integer&N,doublereal*A,integer&LDA,doublereal*W,doublereal*WORK,integer&LWORK,integer&INFO);
128 };
129 inline void DSYEV(char&JOBZ,char&UPLO,integer&N,doublereal*A,integer&LDA,doublereal*W,doublereal*WORK,integer&LWORK,integer&INFO){
130  dsyev(JOBZ,UPLO,N,A,LDA,W,WORK,LWORK,INFO);
131 }
139 extern "C" {
140  void dspev(char&JOBZ,char&UPLO,integer&N,doublereal*AP,doublereal*W,doublereal*Z,integer&LDZ,doublereal*WORK,integer&INFO);
141 };
142 inline void DSPEV(char&JOBZ,char&UPLO,integer&N,doublereal*AP,doublereal*W,doublereal*Z,integer&LDZ,doublereal*WORK,integer&INFO){
143  dspev(JOBZ,UPLO,N,AP,W,Z,LDZ,WORK,INFO);
144 }
145 
153 extern "C" {
154  void dgesvd(char&JOBU,char&JOBVT,integer&M,integer&N,doublereal*A,integer&LDA,doublereal*S,doublereal*U,integer&LDU,doublereal*VT,integer&LDVT,doublereal*WORK,integer&LWORK,integer&INFO);
155 };
156 inline void DGESVD(char&JOBU,char&JOBVT,integer&M,integer&N,doublereal*A,integer&LDA,doublereal*S,doublereal*U,integer&LDU,doublereal*VT,integer&LDVT,doublereal*WORK,integer&LWORK,integer&INFO){
157  dgesvd(JOBU,JOBVT,M,N,A,LDA,S,U,LDU,VT,LDVT,WORK,LWORK,INFO);
158 }
159 
160 }}
161 
162 #endif
long int integer
Definition: fnocc/blas.h:37
int * U
Definition: stringlist.cc:65
void DGEMV(char &trans, integer &m, integer &n, doublereal &alpha, doublereal *A, integer &lda, doublereal *X, integer &incx, doublereal &beta, doublereal *Y, integer &incy)
Definition: fnocc/blas.h:61
void DCOPY(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy)
Definition: fnocc/blas.h:86
void DSPEV(char &JOBZ, char &UPLO, integer &N, doublereal *AP, doublereal *W, doublereal *Z, integer &LDZ, doublereal *WORK, integer &INFO)
Definition: fnocc/blas.h:142
void SVD(integer M, integer N, doublereal *A, doublereal *U, doublereal *VT, doublereal *S)
Definition: fnocc/blas.cc:83
void dgesvd(char &JOBU, char &JOBVT, integer &M, integer &N, doublereal *A, integer &LDA, doublereal *S, doublereal *U, integer &LDU, doublereal *VT, integer &LDVT, doublereal *WORK, integer &LWORK, integer &INFO)
void Diagonalize2(integer N, doublereal *AP, doublereal *W, doublereal *Z)
Definition: fnocc/blas.cc:70
void dsyev(char &JOBZ, char &UPLO, integer &N, doublereal *A, integer &LDA, doublereal *W, doublereal *WORK, integer &LWORK, integer &INFO)
void dcopy(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy)
double doublereal
Definition: fnocc/blas.h:38
void DGESVD(char &JOBU, char &JOBVT, integer &M, integer &N, doublereal *A, integer &LDA, doublereal *S, doublereal *U, integer &LDU, doublereal *VT, integer &LDVT, doublereal *WORK, integer &LWORK, integer &INFO)
Definition: fnocc/blas.h:156
void dgemm(char &transa, char &transb, integer &m, integer &n, integer &k, doublereal &alpha, doublereal *A, integer &lda, doublereal *B, integer &ldb, doublereal &beta, doublereal *C, integer &ldc)
void F_DGEMV(char trans, integer m, integer n, doublereal alpha, doublereal *A, integer lda, doublereal *X, integer incx, doublereal beta, doublereal *Y, integer incy)
Definition: fnocc/blas.cc:44
void DGESV(integer &N, integer &NRHS, doublereal *A, integer &LDA, integer *IPIV, doublereal *B, integer &LDB, integer &INFO)
Definition: fnocc/blas.h:105
double dnrm2(integer &N, doublereal *X, integer &INCX)
SharedWavefunction fnocc(SharedWavefunction, Options &)
Definition: fnocc.cc:36
void DSYEV(char &JOBZ, char &UPLO, integer &N, doublereal *A, integer &LDA, doublereal *W, doublereal *WORK, integer &LWORK, integer &INFO)
Definition: fnocc/blas.h:129
void Diagonalize(integer N, doublereal *A, doublereal *W)
Definition: fnocc/blas.cc:60
void DGEMM(char &transa, char &transb, integer &m, integer &n, integer &k, doublereal &alpha, doublereal *A, integer &lda, doublereal *B, integer &ldb, doublereal &beta, doublereal *C, integer &ldc)
Definition: fnocc/blas.h:73
double ddot(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy)
CCTransform * trans
Definition: psimrcc/main.cc:79
double DNRM2(integer &N, doublereal *X, integer &INCX)
Definition: fnocc/blas.h:96
void dgesv(integer &N, integer &NRHS, doublereal *A, integer &LDA, integer *IPIV, doublereal *B, integer &LDB, integer &INFO)
double DDOT(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy)
Definition: fnocc/blas.h:114
void dgemv(char &trans, integer &m, integer &n, doublereal &alpha, doublereal *A, integer &lda, doublereal *X, integer &incx, doublereal &beta, doublereal *Y, integer &incy)
Definition: PsiFileImpl.h:38
void F_DGEMM(char transa, char transb, integer m, integer n, integer k, doublereal alpha, doublereal *A, integer lda, doublereal *B, integer ldb, doublereal beta, doublereal *C, integer ldc)
Definition: fnocc/blas.cc:51
void dspev(char &JOBZ, char &UPLO, integer &N, doublereal *AP, doublereal *W, doublereal *Z, integer &LDZ, doublereal *WORK, integer &INFO)