-
Notifications
You must be signed in to change notification settings - Fork 9
/
LaFullDirectSolver.h
74 lines (67 loc) · 2.54 KB
/
LaFullDirectSolver.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef LAFULLDIRECTSOLVER_H
#define LAFULLDIRECTSOLVER_H
#include <fstream>
#include "Definitions.h"
#include "IntVec.h"
#include "Mat.h"
#include "LinearSolver.h"
#include "DataCollector.h"
#include "Vec.h"
#include "VecOperators.h"
#include "VecBlas.h"
namespace Daetk
{
#ifdef CRAYCC
#include <fortran.h>
extern "C" void F77NAME(DGETRF)(const int& m, const int* n, double* A, const int* lda,
int* ipiv, int* info);
extern "C" void F77NAME(DGETRS)(_fcd trans, const int* n, const int* nrhs,
double * A, const int* lda, int* ipiv, double* b,
const int* ldb, int* info);
extern "C" void F77NAME(DGECON)(_fcd,const int&,
double*, const int&, double*,
double*,double*,int*,const int&);
extern "C" void F77NAME(SGETRF)(const int* m, const int* n, float* A, const int* lda,
int* ipiv, int* info);
extern "C" void F77NAME(SGETRS)(_fcd trans, const int* n, const int* nrhs,
float * A, const int* lda, int* ipiv, float* b,
const int* ldb, int* info);
#else
extern "C" void F77NAME(dgetrf)(const int& m, const int& n, double* A, const int& lda,
int* ipiv, int& info);
extern "C" void F77NAME(dgetrs)(const char* trans, const int& n, const int& nrhs,
double * A, const int& lda, int* ipiv, double* b,
const int& ldb, int& info);
extern "C" void F77NAME(dgecon)(const char*,const int&,
double*, const int&, double*,
double*,double*,int*,const int&);
extern "C" void F77NAME(sgetrf)(const int& m, const int& n, float* A, const int& lda,
int* ipiv, int& info);
extern "C" void F77NAME(sgetrs)(const char* trans, const int& n, const int& nrhs,
float * A, const int& lda, int* ipiv, float* b,
const int& ldb, int& info);
#endif
class LaFullDirectSolver : public LinearSolver
{
public:
LaFullDirectSolver();
LaFullDirectSolver(Mat& Min);
virtual ~LaFullDirectSolver();
bool prepare();
bool solve(const Vec& bIn, Vec& xIn);
void attachMat(Mat& Min);
void printMatrices(const char* filename);
void calculateCondition(DataCollector& d);
private:
bool PRINT_MATRICES,CALCULATE_CONDITION;
std::ofstream matOut;
int neq;
int LEAD_DIM_STORAGE,errorFlag;
real* arrayptr,*rwork;\
int* pivotptr,*iwork;
AttacheVec x;
Mat* M;
DataCollector* data;
};
}//Daetk
#endif