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 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 "blas_mangle.h"
37 
38 typedef long int integer;
39 typedef double doublereal;
40 
41 namespace psi{ namespace fnocc{
42 
46 void F_DGEMV(char trans,integer m,integer n,doublereal alpha,doublereal*A,integer lda,
47  doublereal*X,integer incx,doublereal beta,doublereal*Y,integer incy);
51 void F_DGEMM(char transa,char transb, integer m, integer n, integer k,
53  doublereal beta,doublereal*C,integer ldc);
54 
58 extern "C" {
59  void dgemv(char&trans,integer&m,integer&n,doublereal&alpha,doublereal*A,integer&lda,
60  doublereal*X,integer&incx,doublereal&beta,doublereal*Y,integer&incy);
61 };
62 inline void DGEMV(char&trans,integer&m,integer&n,doublereal&alpha,doublereal*A,integer&lda,
63  doublereal*X,integer&incx,doublereal&beta,doublereal*Y,integer&incy){
64  dgemv(trans,m,n,alpha,A,lda,X,incx,beta,Y,incy);
65 }
69 extern "C" {
70  void dgemm(char&transa,char&transb,integer&m,integer&n,integer&k,
72  doublereal&beta,doublereal*C,integer&ldc);
73 };
74 inline void DGEMM(char&transa,char&transb,integer&m,integer&n,integer&k,
76  doublereal&beta,doublereal*C,integer&ldc)
77 {
78  dgemm(transa,transb,m,n,k,alpha,A,lda,B,ldb,beta,C,ldc);
79 };
83 extern "C" {
84  void dcopy(integer&n,doublereal*dx,integer&incx,doublereal*dy,
85  integer&incy);
86 };
87 inline void DCOPY(integer&n,doublereal*dx,integer&incx,doublereal*dy,
88  integer&incy){
89  dcopy(n,dx,incx,dy,incy);
90 }
94 extern"C"{
95  double dnrm2(integer&N,doublereal*X,integer&INCX);
96 };
97 inline double DNRM2(integer&N,doublereal*X,integer&INCX){
98  return dnrm2(N,X,INCX);
99 };
103 extern"C" {
104  void dgesv(integer &N,integer &NRHS,doublereal*A,integer &LDA,integer*IPIV,doublereal*B,integer &LDB,integer &INFO);
105 };
106 inline void DGESV(integer &N,integer &NRHS,doublereal*A,integer &LDA,integer*IPIV,doublereal*B,integer &LDB,integer &INFO){
107  dgesv(N,NRHS,A,LDA,IPIV,B,LDB,INFO);
108 };
112 extern "C" {
113  double ddot(integer&n,doublereal*dx,integer&incx,doublereal*dy,integer&incy);
114 };
115 inline double DDOT(integer&n,doublereal*dx,integer&incx,doublereal*dy,integer&incy){
116  return ddot(n,dx,incx,dy,incy);
117 }
118 
119 
127 extern "C" {
128  void dsyev(char&JOBZ,char&UPLO,integer&N,doublereal*A,integer&LDA,doublereal*W,doublereal*WORK,integer&LWORK,integer&INFO);
129 };
130 inline void DSYEV(char&JOBZ,char&UPLO,integer&N,doublereal*A,integer&LDA,doublereal*W,doublereal*WORK,integer&LWORK,integer&INFO){
131  dsyev(JOBZ,UPLO,N,A,LDA,W,WORK,LWORK,INFO);
132 }
140 extern "C" {
141  void dspev(char&JOBZ,char&UPLO,integer&N,doublereal*AP,doublereal*W,doublereal*Z,integer&LDZ,doublereal*WORK,integer&INFO);
142 };
143 inline void DSPEV(char&JOBZ,char&UPLO,integer&N,doublereal*AP,doublereal*W,doublereal*Z,integer&LDZ,doublereal*WORK,integer&INFO){
144  dspev(JOBZ,UPLO,N,AP,W,Z,LDZ,WORK,INFO);
145 }
146 
154 extern "C" {
155  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);
156 };
157 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){
158  dgesvd(JOBU,JOBVT,M,N,A,LDA,S,U,LDU,VT,LDVT,WORK,LWORK,INFO);
159 }
160 
161 }}
162 
163 #endif
long int integer
Definition: fnocc/blas.h:38
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:62
void DCOPY(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy)
Definition: fnocc/blas.h:87
void DSPEV(char &JOBZ, char &UPLO, integer &N, doublereal *AP, doublereal *W, doublereal *Z, integer &LDZ, doublereal *WORK, integer &INFO)
Definition: fnocc/blas.h:143
void SVD(integer M, integer N, doublereal *A, doublereal *U, doublereal *VT, doublereal *S)
Definition: fnocc/blas.cc:84
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:71
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:39
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:157
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:45
void DGESV(integer &N, integer &NRHS, doublereal *A, integer &LDA, integer *IPIV, doublereal *B, integer &LDB, integer &INFO)
Definition: fnocc/blas.h:106
double dnrm2(integer &N, doublereal *X, integer &INCX)
SharedWavefunction fnocc(SharedWavefunction, Options &)
Definition: fnocc.cc:37
void DSYEV(char &JOBZ, char &UPLO, integer &N, doublereal *A, integer &LDA, doublereal *W, doublereal *WORK, integer &LWORK, integer &INFO)
Definition: fnocc/blas.h:130
void Diagonalize(integer N, doublereal *A, doublereal *W)
Definition: fnocc/blas.cc:61
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:74
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:97
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:115
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:39
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:52
void dspev(char &JOBZ, char &UPLO, integer &N, doublereal *AP, doublereal *W, doublereal *Z, integer &LDZ, doublereal *WORK, integer &INFO)