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 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 *,
48  double *, int *, double *, int *, double *, int *, int *);
49 
50 extern int F_DGESV(int *, int *, double *, int *, int *, double *, int *,
51  int *);
52 
53 extern int F_DGETRF(int *, int *, double *, int *, int*, int *);
54 
55 extern int F_DGETRI(int *, double *, int *, int *, double *, int *, int *);
56 
57 extern int F_DPOTRF(char *, int *, double *, int *, int*);
58 
59 extern int F_DPOTRS(char *, int*, int*, double *, int *, double *, int *, int *);
60 
61 extern int F_DPOTRI(char *, int *, double *, int *, int*);
62 
63 extern int F_DGESVD(char *, char *, int *, int *, double *, int *,
64  double *, double *, int *, double *, int *, double *, int *, int *);
65 
66 extern int F_DSYEV(char *, char *, int *, double *, int *, double *,
67  double *, int *, int *);
68 }
69 
70 namespace psi {
128 int C_DGEEV(int n, double **a, int lda,
129  double *wr, double *wi, double **vl, int ldvl, double **vr,
130  int ldvr, double *work, int lwork, int info)
131 {
132  char jobvl, jobvr;
133  jobvl = 'V';
134  jobvr = 'V';
135  ::F_DGEEV(&jobvl, &jobvr, &n, &(a[0][0]), &lda, &(wr[0]), &(wi[0]),
136  &(vl[0][0]), &ldvl, &(vr[0][0]), &ldvr, &(work[0]), &lwork, &info);
137 
138  return info;
139 }
140 
141 
178 int C_DGESV(int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb)
179 {
180  int info;
181 
182  ::F_DGESV(&n, &nrhs, &(a[0]), &lda, &(ipiv[0]), &(b[0]), &ldb, &info);
183 
184  return info;
185 }
186 
187 
214 int C_DGETRF(int nrow, int ncol, double *a, int lda, int *ipiv)
215 {
216  int info;
217 
218  ::F_DGETRF(&ncol, &nrow, &(a[0]), &lda, &(ipiv[0]), &info);
219 
220  return info;
221 }
222 
223 
243 int C_DPOTRF(char uplo, int n, double *A, int lda)
244 {
245  int info;
246 
247  ::F_DPOTRF(&uplo, &n, &(A[0]), &lda, &info);
248 
249  return info;
250 }
282 int C_DGETRI(int n, double *a, int lda, int *ipiv, double *work, int lwork)
283 {
284  int info;
285 
286  ::F_DGETRI(&n, &(a[0]), &lda, &(ipiv[0]), &(work[0]), &lwork, &info);
287 
288  return info;
289 }
307 int C_DPOTRI(char uplo, int n, double *A, int lda)
308 {
309  int info;
310 
311  ::F_DPOTRI(&uplo, &n, &(A[0]), &lda, &info);
312 
313  return info;
314 }
334 int C_DPOTRS(char uplo, int n, int nrhs, double *A, int lda, double *B, int ldb)
335 {
336  int info;
337 
338 
339  ::F_DPOTRS(&uplo, &n, &nrhs, &(A[0]), &lda, &(B[0]), &ldb, &info);
340 
341  return info;
342 }
343 
344 
428 int C_DGESVD(char jobu, char jobvt, int m, int n, double *A, int lda,
429  double *s, double *u, int ldu, double *vt, int ldvt, double *work, int lwork)
430 {
431  int info;
432 
433  ::F_DGESVD(&jobvt, &jobu, &n, &m, A, &lda, s, vt, &ldvt, u, &ldu, work,
434  &lwork, &info);
435 
436  return info;
437 }
438 
439 
481 int C_DSYEV(char jobz, char uplo, int n, double *A, int lda, double *w,
482  double *work, int lwork)
483 {
484  int info;
485 
486  ::F_DSYEV(&jobz, &uplo, &n, A, &lda, w, work, &lwork, &info);
487 
488  return info;
489 }
490 
491 }
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:10527
int C_DPOTRS(char uplo, int n, int nrhs, double *a, int lda, double *b, int ldb)
Definition: lapack_intfc.cc:10623
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:428
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:2236
int C_DPOTRI(char uplo, int n, double *a, int lda)
Definition: lapack_intfc.cc:10572
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:4557
#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:4499
int C_DSYEV(char jobz, char uplo, int n, double *a, int lda, double *w, double *work, int lwork)
Definition: lapack_intfc.cc:15548
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:4207
Definition: PsiFileImpl.h:39