linalg.cpp
867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// This file contains a set of wrapper functions that are linked to the corresponding functions in CLAPACK
extern "C" {
#include "f2c.h"
#include "clapack.h"
}
void LINALG_dgeev(
char JOBVL,
char JOBVR,
int n,
double* A,
int LDA,
double* WR,
double* WI,
double* VL,
int LDVL,
double* VR,
int LDVR)
{
integer LWORK = -1;
double WORK[1];
integer INFO;
dgeev_(&JOBVL, &JOBVR, (integer*)&n, A, (integer*)&LDA, WR, WI, VL, (integer*)&LDVL, VR, (integer*)&LDVR, WORK, &LWORK, &INFO);
}
void LINALG_dgetrf(
int M,
int N,
double* A,
int LDA,
int* IPIV)
{
integer INFO;
dgetrf_((integer*)&M, (integer*)&N, A, (integer*)&LDA, (integer*)IPIV, &INFO);
}
void LINALG_dgetri(
int N,
double* A,
int LDA,
int* IPIV)
{
integer LWORK = -1;
double WORK[1];
integer INFO;
dgetri_((integer*)&N, A, (integer*)&LDA, (integer*)IPIV, WORK, &LWORK, &INFO);
}