Psi4
lapack_intfc.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 
44 #include "lapack_intfc_mangle.h"
45 
46 extern "C" {
47 extern int F_DGEEV(char *, char *, int *, double *, int *, double *, double *, double *, int *, double *, int *,
48  double *, int *, int *);
49 
50 extern int F_DGESV(int *, int *, double *, int *, int *, double *, int *, int *);
51 
52 extern int F_DGETRF(int *, int *, double *, int *, int *, int *);
53 
54 extern int F_DGETRI(int *, double *, int *, int *, double *, int *, int *);
55 
56 extern int F_DPOTRF(char *, int *, double *, int *, int *);
57 
58 extern int F_DPOTRS(char *, int *, int *, double *, int *, double *, int *, int *);
59 
60 extern int F_DPOTRI(char *, int *, double *, int *, int *);
61 
62 extern int F_DGESVD(char *, char *, int *, int *, double *, int *, double *, double *, int *, double *, int *, double *,
63  int *, int *);
64 
65 extern int F_DSYEV(char *, char *, int *, double *, int *, double *, double *, int *, int *);
66 }
67 
68 namespace psi {
126 int C_DGEEV(int n, double **a, int lda, double *wr, double *wi, double **vl, int ldvl, double **vr, int ldvr,
127  double *work, int lwork, int info) {
128  char jobvl, jobvr;
129  jobvl = 'V';
130  jobvr = 'V';
131  ::F_DGEEV(&jobvl, &jobvr, &n, &(a[0][0]), &lda, &(wr[0]), &(wi[0]), &(vl[0][0]), &ldvl, &(vr[0][0]), &ldvr,
132  &(work[0]), &lwork, &info);
133 
134  return info;
135 }
136 
173 int C_DGESV(int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb) {
174  int info;
175 
176  ::F_DGESV(&n, &nrhs, &(a[0]), &lda, &(ipiv[0]), &(b[0]), &ldb, &info);
177 
178  return info;
179 }
180 
207 int C_DGETRF(int nrow, int ncol, double *a, int lda, int *ipiv) {
208  int info;
209 
210  ::F_DGETRF(&ncol, &nrow, &(a[0]), &lda, &(ipiv[0]), &info);
211 
212  return info;
213 }
214 
234 int C_DPOTRF(char uplo, int n, double *A, int lda) {
235  int info;
236 
237  ::F_DPOTRF(&uplo, &n, &(A[0]), &lda, &info);
238 
239  return info;
240 }
272 int C_DGETRI(int n, double *a, int lda, int *ipiv, double *work, int lwork) {
273  int info;
274 
275  ::F_DGETRI(&n, &(a[0]), &lda, &(ipiv[0]), &(work[0]), &lwork, &info);
276 
277  return info;
278 }
296 int C_DPOTRI(char uplo, int n, double *A, int lda) {
297  int info;
298 
299  ::F_DPOTRI(&uplo, &n, &(A[0]), &lda, &info);
300 
301  return info;
302 }
322 int C_DPOTRS(char uplo, int n, int nrhs, double *A, int lda, double *B, int ldb) {
323  int info;
324 
325  ::F_DPOTRS(&uplo, &n, &nrhs, &(A[0]), &lda, &(B[0]), &ldb, &info);
326 
327  return info;
328 }
329 
413 int C_DGESVD(char jobu, char jobvt, int m, int n, double *A, int lda, double *s, double *u, int ldu, double *vt,
414  int ldvt, double *work, int lwork) {
415  int info;
416 
417  ::F_DGESVD(&jobvt, &jobu, &n, &m, A, &lda, s, vt, &ldvt, u, &ldu, work, &lwork, &info);
418 
419  return info;
420 }
421 
463 int C_DSYEV(char jobz, char uplo, int n, double *A, int lda, double *w, double *work, int lwork) {
464  int info;
465 
466  ::F_DSYEV(&jobz, &uplo, &n, A, &lda, w, work, &lwork, &info);
467 
468  return info;
469 }
470 
471 } // namespace psi
The PSI3 LAPACK interface routines.
#define F_DGETRF
Definition: mcscf/algebra_interface_mangle.h:64
#define F_DGETRI
Definition: mcscf/algebra_interface_mangle.h:65
#define F_DGEEV
Definition: mcscf/algebra_interface_mangle.h:62
double ** u
Definition: dx_write.cc:57
int C_DPOTRF(char uplo, int n, double *a, int lda)
Definition: lapack_intfc.cc:10572
int C_DGESV(int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb)
Definition: lapack_intfc.cc:4256
int C_DPOTRS(char uplo, int n, int nrhs, double *a, int lda, double *b, int ldb)
Definition: lapack_intfc.cc:10666
int C_DGESVD(char jobu, char jobvt, int m, int n, double *A, int lda, double *s, double *u, int ldu, double *vt, int ldvt, double *work, int lwork)
Definition: lapack_intfc.h:413
int C_DGEEV(char jobvl, char jobvr, int n, double *a, int lda, double *wr, double *wi, double *vl, int ldvl, double *vr, int ldvr, double *work, int lwork)
Definition: lapack_intfc.cc:2290
int C_DPOTRI(char uplo, int n, double *a, int lda)
Definition: lapack_intfc.cc:10616
int F_DPOTRI(char *, int *, double *, int *, int *)
int C_DGETRI(int n, double *a, int lda, int *ipiv, double *work, int lwork)
Definition: lapack_intfc.cc:4606
#define F_DSYEV
Definition: mcscf/algebra_interface_mangle.h:67
#define F_DGESV
Definition: mcscf/algebra_interface_mangle.h:63
int F_DGESVD(char *, char *, int *, int *, double *, int *, double *, double *, int *, double *, int *, double *, int *, int *)
int F_DPOTRS(char *, int *, int *, double *, int *, double *, int *, int *)
int C_DGETRF(int m, int n, double *a, int lda, int *ipiv)
Definition: lapack_intfc.cc:4549
int C_DSYEV(char jobz, char uplo, int n, double *a, int lda, double *w, double *work, int lwork)
Definition: lapack_intfc.cc:15573
int F_DPOTRF(char *, int *, double *, int *, int *)