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-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 
43 #include "lapack_intfc_mangle.h"
44 
45 extern "C" {
46 extern int F_DGEEV(char *, char *, int *, double *, int *, double *, double *,
47  double *, int *, double *, int *, double *, int *, int *);
48 
49 extern int F_DGESV(int *, int *, double *, int *, int *, double *, int *,
50  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 *,
63  double *, double *, int *, double *, int *, double *, int *, int *);
64 
65 extern int F_DSYEV(char *, char *, int *, double *, int *, double *,
66  double *, int *, int *);
67 }
68 
69 namespace psi {
127 int C_DGEEV(int n, double **a, int lda,
128  double *wr, double *wi, double **vl, int ldvl, double **vr,
129  int ldvr, double *work, int lwork, int info)
130 {
131  char jobvl, jobvr;
132  jobvl = 'V';
133  jobvr = 'V';
134  ::F_DGEEV(&jobvl, &jobvr, &n, &(a[0][0]), &lda, &(wr[0]), &(wi[0]),
135  &(vl[0][0]), &ldvl, &(vr[0][0]), &ldvr, &(work[0]), &lwork, &info);
136 
137  return info;
138 }
139 
140 
177 int C_DGESV(int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb)
178 {
179  int info;
180 
181  ::F_DGESV(&n, &nrhs, &(a[0]), &lda, &(ipiv[0]), &(b[0]), &ldb, &info);
182 
183  return info;
184 }
185 
186 
213 int C_DGETRF(int nrow, int ncol, double *a, int lda, int *ipiv)
214 {
215  int info;
216 
217  ::F_DGETRF(&ncol, &nrow, &(a[0]), &lda, &(ipiv[0]), &info);
218 
219  return info;
220 }
221 
222 
242 int C_DPOTRF(char uplo, int n, double *A, int lda)
243 {
244  int info;
245 
246  ::F_DPOTRF(&uplo, &n, &(A[0]), &lda, &info);
247 
248  return info;
249 }
281 int C_DGETRI(int n, double *a, int lda, int *ipiv, double *work, int lwork)
282 {
283  int info;
284 
285  ::F_DGETRI(&n, &(a[0]), &lda, &(ipiv[0]), &(work[0]), &lwork, &info);
286 
287  return info;
288 }
306 int C_DPOTRI(char uplo, int n, double *A, int lda)
307 {
308  int info;
309 
310  ::F_DPOTRI(&uplo, &n, &(A[0]), &lda, &info);
311 
312  return info;
313 }
333 int C_DPOTRS(char uplo, int n, int nrhs, double *A, int lda, double *B, int ldb)
334 {
335  int info;
336 
337 
338  ::F_DPOTRS(&uplo, &n, &nrhs, &(A[0]), &lda, &(B[0]), &ldb, &info);
339 
340  return info;
341 }
342 
343 
427 int C_DGESVD(char jobu, char jobvt, int m, int n, double *A, int lda,
428  double *s, double *u, int ldu, double *vt, int ldvt, double *work, int lwork)
429 {
430  int info;
431 
432  ::F_DGESVD(&jobvt, &jobu, &n, &m, A, &lda, s, vt, &ldvt, u, &ldu, work,
433  &lwork, &info);
434 
435  return info;
436 }
437 
438 
480 int C_DSYEV(char jobz, char uplo, int n, double *A, int lda, double *w,
481  double *work, int lwork)
482 {
483  int info;
484 
485  ::F_DSYEV(&jobz, &uplo, &n, A, &lda, w, work, &lwork, &info);
486 
487  return info;
488 }
489 
490 }
The PSI3 LAPACK interface routines.
#define F_DGETRF
Definition: mcscf/algebra_interface_mangle.h:63
#define F_DGETRI
Definition: mcscf/algebra_interface_mangle.h:64
#define F_DGEEV
Definition: mcscf/algebra_interface_mangle.h:61
double ** u
Definition: dx_write.cc:56
int C_DPOTRF(char uplo, int n, double *a, int lda)
Definition: lapack_intfc.cc:10526
int C_DPOTRS(char uplo, int n, int nrhs, double *a, int lda, double *b, int ldb)
Definition: lapack_intfc.cc:10622
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:427
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:2235
int C_DPOTRI(char uplo, int n, double *a, int lda)
Definition: lapack_intfc.cc:10571
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:4556
#define F_DSYEV
Definition: mcscf/algebra_interface_mangle.h:66
#define F_DGESV
Definition: mcscf/algebra_interface_mangle.h:62
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:4498
int C_DSYEV(char jobz, char uplo, int n, double *a, int lda, double *w, double *work, int lwork)
Definition: lapack_intfc.cc:15547
int F_DPOTRF(char *, int *, double *, int *, int *)
int C_DGESV(int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb)
Definition: lapack_intfc.cc:4206
Definition: PsiFileImpl.h:38