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 {
43 namespace fnocc {
44 
48 void PSI_API F_DGEMV(char trans, integer m, integer n, doublereal alpha, doublereal *A, integer lda, doublereal *X,
49  integer incx, doublereal beta, doublereal *Y, integer incy);
53 void PSI_API F_DGEMM(char transa, char transb, integer m, integer n, integer k, doublereal alpha, doublereal *A,
54  integer lda, doublereal *B, integer ldb, 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, doublereal *X,
61  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, doublereal *X,
64  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, doublereal &alpha, doublereal *A,
72  integer &lda, doublereal *B, integer &ldb, doublereal &beta, doublereal *C, integer &ldc);
73 };
74 inline void DGEMM(char &transa, char &transb, integer &m, integer &n, integer &k, doublereal &alpha, doublereal *A,
75  integer &lda, doublereal *B, integer &ldb, doublereal &beta, doublereal *C, integer &ldc) {
76  dgemm(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
77 };
81 extern "C" {
82 void dcopy(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy);
83 };
84 inline void DCOPY(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy) {
85  dcopy(n, dx, incx, dy, incy);
86 }
90 extern "C" {
91 double dnrm2(integer &N, doublereal *X, integer &INCX);
92 };
93 inline double DNRM2(integer &N, doublereal *X, integer &INCX) { return dnrm2(N, X, INCX); };
97 extern "C" {
98 void dgesv(integer &N, integer &NRHS, doublereal *A, integer &LDA, integer *IPIV, doublereal *B, integer &LDB,
99  integer &INFO);
100 };
101 inline void DGESV(integer &N, integer &NRHS, doublereal *A, integer &LDA, integer *IPIV, doublereal *B, integer &LDB,
102  integer &INFO) {
103  dgesv(N, NRHS, A, LDA, IPIV, B, LDB, INFO);
104 };
108 extern "C" {
109 double ddot(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy);
110 };
111 inline double DDOT(integer &n, doublereal *dx, integer &incx, doublereal *dy, integer &incy) {
112  return ddot(n, dx, incx, dy, incy);
113 }
114 
118 void Diagonalize(integer N, doublereal *A, doublereal *W);
122 extern "C" {
123 void dsyev(char &JOBZ, char &UPLO, integer &N, doublereal *A, integer &LDA, doublereal *W, doublereal *WORK,
124  integer &LWORK, integer &INFO);
125 };
126 inline void DSYEV(char &JOBZ, char &UPLO, integer &N, doublereal *A, integer &LDA, doublereal *W, doublereal *WORK,
127  integer &LWORK, integer &INFO) {
128  dsyev(JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, INFO);
129 }
137 extern "C" {
138 void dspev(char &JOBZ, char &UPLO, integer &N, doublereal *AP, doublereal *W, doublereal *Z, integer &LDZ,
139  doublereal *WORK, integer &INFO);
140 };
141 inline void DSPEV(char &JOBZ, char &UPLO, integer &N, doublereal *AP, doublereal *W, doublereal *Z, integer &LDZ,
142  doublereal *WORK, integer &INFO) {
143  dspev(JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, INFO);
144 }
145 
149 void SVD(integer M, integer N, doublereal *A, doublereal *U, doublereal *VT, doublereal *S);
153 extern "C" {
154 void dgesvd(char &JOBU, char &JOBVT, integer &M, integer &N, doublereal *A, integer &LDA, doublereal *S, doublereal *U,
155  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,
158  doublereal *U, integer &LDU, doublereal *VT, integer &LDVT, doublereal *WORK, integer &LWORK,
159  integer &INFO) {
160  dgesvd(JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO);
161 }
162 }
163 }
164 
165 #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:84
void DSPEV(char &JOBZ, char &UPLO, integer &N, doublereal *AP, doublereal *W, doublereal *Z, integer &LDZ, doublereal *WORK, integer &INFO)
Definition: fnocc/blas.h:141
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: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 DGESV(integer &N, integer &NRHS, doublereal *A, integer &LDA, integer *IPIV, doublereal *B, integer &LDB, integer &INFO)
Definition: fnocc/blas.h:101
double dnrm2(integer &N, doublereal *X, integer &INCX)
SharedWavefunction fnocc(SharedWavefunction, Options &)
Definition: fnocc.cc:40
void DSYEV(char &JOBZ, char &UPLO, integer &N, doublereal *A, integer &LDA, doublereal *W, doublereal *WORK, integer &LWORK, integer &INFO)
Definition: fnocc/blas.h:126
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: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:93
#define PSI_API
Definition: pragma.h:155
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:111
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:48
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:55
void dspev(char &JOBZ, char &UPLO, integer &N, doublereal *AP, doublereal *W, doublereal *Z, integer &LDZ, doublereal *WORK, integer &INFO)