-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathLaFullCholeskySolver.h
54 lines (49 loc) · 1.55 KB
/
LaFullCholeskySolver.h
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
50
51
52
53
54
#ifndef LAFULLCHOLESKYSOLVER_H
#define LAFULLCHOLESKYSOLVER_H
#include "Definitions.h"
#include "Mat.h"
#include "LinearSolver.h"
#include "Vec.h"
#include "VecBlas.h"
#include "VectorFunction.h"
namespace Daetk
{
extern "C"
{
#ifdef CRAYCC
#include <fortran.h>
void F77NAME(dpotrf)(const char& uplo, const int& n, double* a, const int& lda, int& info);
void F77NAME(dpotrs)(const char& uplo, const int& n, const int& nrhs, double* a, const int& lda,
double* b,const int& ldb, int& info);
void F77NAME(SPOTRF)(const char& uplo, const int& n, float* a, const int& lda, int& info);
void F77NAME(SPOTRS)(const char& uplo, const int& n, const int& nrhs, float* a, const int& lda,
float* b,const int& ldb, int& info);
#else
void F77NAME(dpotrf)(const char& uplo, const int& n, double* a, const int& lda, int& info);
void F77NAME(dpotrs)(const char& uplo, const int& n, const int& nrhs, double* a, const int& lda,
double* b,const int& ldb, int& info);
void F77NAME(spotrf)(const char& uplo, const int& n, float* a, const int& lda, int& info);
void F77NAME(spotrs)(const char& uplo, const int& n, const int& nrhs, float* a, const int& lda,
float* b,const int& ldb, int& info);
#endif
}
class LaFullCholeskySolver : public LinearSolver
{
public:
LaFullCholeskySolver();
LaFullCholeskySolver(Mat& Min);
virtual ~LaFullCholeskySolver();
void storeLower();
void storeUpper();
bool prepare();
bool solve(const Vec& b,Vec& x);
private:
char uplo;
int neq;
int LEAD_DIM_STORAGE,errorFlag;
AttacheVec x;
real* arrayptr;
Mat* M;
};
}//Daetk
#endif