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-2018 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef BLAS_H
30 #define BLAS_H
31 
36 #include "psi4/pragma.h"
37 #include "blas_mangle.h"
38 
39 typedef long int integer;
40 typedef double doublereal;
41 
42 namespace psi{ namespace fnocc{
43 
47 void F_DGEMV(char trans,integer m,integer n,doublereal alpha,doublereal*A,integer lda,
48  doublereal*X,integer incx,doublereal beta,doublereal*Y,integer incy);
52 void PSI_API F_DGEMM(char transa,char transb, integer m, integer n, integer k,
54  doublereal beta,doublereal*C,integer ldc);
55 
59 extern "C" {
60  void dgemv(char&trans,integer&m,integer&n,doublereal&alpha,doublereal*A,integer&lda,
61  doublereal*X,integer&incx,doublereal&beta,doublereal*Y,integer&incy);
62 };
63 inline void DGEMV(char&trans,integer&m,integer&n,doublereal&alpha,doublereal*A,integer&lda,
64  doublereal*X,integer&incx,doublereal&beta,doublereal*Y,integer&incy){
65  dgemv(trans,m,n,alpha,A,lda,X,incx,beta,Y,incy);
66 }
70 extern "C" {
71  void dgemm(char&transa,char&transb,integer&m,integer&n,integer&k,
73  doublereal&beta,doublereal*C,integer&ldc);
74 };
75 inline void DGEMM(char&transa,char&transb,integer&m,integer&n,integer&k,
77  doublereal&beta,doublereal*C,integer&ldc)
78 {
79  dgemm(transa,transb,m,n,k,alpha,A,lda,B,ldb,beta,C,ldc);
80 };
84 extern "C" {
85  void dcopy(integer&n,doublereal*dx,integer&incx,doublereal*dy,
86  integer&incy);
87 };
88 inline void DCOPY(integer&n,doublereal*dx,integer&incx,doublereal*dy,
89  integer&incy){
90  dcopy(n,dx,incx,dy,incy);
91 }
95 extern"C"{
96  double dnrm2(integer&N,doublereal*X,integer&INCX);
97 };
98 inline double DNRM2(integer&N,doublereal*X,integer&INCX){
99  return dnrm2(N,X,INCX);
100 };
104 extern"C" {
105  void dgesv(integer &N,integer &NRHS,doublereal*A,integer &LDA,integer*IPIV,doublereal*B,integer &LDB,integer &INFO);
106 };
107 inline void DGESV(integer &N,integer &NRHS,doublereal*A,integer &LDA,integer*IPIV,doublereal*B,integer &LDB,integer &INFO){
108  dgesv(N,NRHS,A,LDA,IPIV,B,LDB,INFO);
109 };
113 extern "C" {
114  double ddot(integer&n,doublereal*dx,integer&incx,doublereal*dy,integer&incy);
115 };
116 inline double DDOT(integer&n,doublereal*dx,integer&incx,doublereal*dy,integer&incy){
117  return ddot(n,dx,incx,dy,incy);
118 }
119 
120 
128 extern "C" {
129  void dsyev(char&JOBZ,char&UPLO,integer&N,doublereal*A,integer&LDA,doublereal*W,doublereal*WORK,integer&LWORK,integer&INFO);
130 };
131 inline void DSYEV(char&JOBZ,char&UPLO,integer&N,doublereal*A,integer&LDA,doublereal*W,doublereal*WORK,integer&LWORK,integer&INFO){
132  dsyev(JOBZ,UPLO,N,A,LDA,W,WORK,LWORK,INFO);
133 }
141 extern "C" {
142  void dspev(char&JOBZ,char&UPLO,integer&N,doublereal*AP,doublereal*W,doublereal*Z,integer&LDZ,doublereal*WORK,integer&INFO);
143 };
144 inline void DSPEV(char&JOBZ,char&UPLO,integer&N,doublereal*AP,doublereal*W,doublereal*Z,integer&LDZ,doublereal*WORK,integer&INFO){
145  dspev(JOBZ,UPLO,N,AP,W,Z,LDZ,WORK,INFO);
146 }
147 
155 extern "C" {
156  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 };
158 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){
159  dgesvd(JOBU,JOBVT,M,N,A,LDA,S,U,LDU,VT,LDVT,WORK,LWORK,INFO);
160 }
161 
162 }}
163 
164 #endif
long int integer
Definition: fnocc/blas.h:39
int * U
Definition: stringlist.cc:66
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:63
void DCOPY(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy)
Definition: fnocc/blas.h:88
void DSPEV(char &JOBZ, char &UPLO, integer &N, doublereal *AP, doublereal *W, doublereal *Z, integer &LDZ, doublereal *WORK, integer &INFO)
Definition: fnocc/blas.h:144
void SVD(integer M, integer N, doublereal *A, doublereal *U, doublereal *VT, doublereal *S)
Definition: fnocc/blas.cc:86
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:73
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:40
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:158
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 PSI_API 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:47
void DGESV(integer &N, integer &NRHS, doublereal *A, integer &LDA, integer *IPIV, doublereal *B, integer &LDB, integer &INFO)
Definition: fnocc/blas.h:107
double dnrm2(integer &N, doublereal *X, integer &INCX)
SharedWavefunction fnocc(SharedWavefunction, Options &)
Definition: fnocc.cc:39
void DSYEV(char &JOBZ, char &UPLO, integer &N, doublereal *A, integer &LDA, doublereal *W, doublereal *WORK, integer &LWORK, integer &INFO)
Definition: fnocc/blas.h:131
void Diagonalize(integer N, doublereal *A, doublereal *W)
Definition: fnocc/blas.cc:63
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:75
double ddot(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy)
CCTransform * trans
Definition: psimrcc/main.cc:80
double DNRM2(integer &N, doublereal *X, integer &INCX)
Definition: fnocc/blas.h:98
#define PSI_API
Definition: pragma.h:153
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:116
void dgemv(char &trans, integer &m, integer &n, doublereal &alpha, doublereal *A, integer &lda, doublereal *X, integer &incx, doublereal &beta, doublereal *Y, integer &incy)
void PSI_API 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:54
void dspev(char &JOBZ, char &UPLO, integer &N, doublereal *AP, doublereal *W, doublereal *Z, integer &LDZ, doublereal *WORK, integer &INFO)