-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathLaBandedDirectSolver.h
78 lines (66 loc) · 2.54 KB
/
LaBandedDirectSolver.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
75
76
77
78
#ifndef LABANDEDDIRECTSOLVER_H
#define LABANDEDDIRECTSOLVER_H
#include <fstream>
#include "Definitions.h"
#include "BandColMat.h"
#include "LinearSolver.h"
#include "DataCollector.h"
#include "Vec.h"
#include "VecBlas.h"
#include "IntVec.h"
namespace Daetk
{
#ifdef CRAYCC
#include <fortran.h>
extern "C" void F77NAME(DGBTRF)(const int&,const int&,const int&,const int&,
double*,const int&,int*,int&);
extern "C" void F77NAME(DGBTRS)(_fcd,const int&,const int&,const int&,
const int&,double*,const int&,int*,double*,
const int&,int&);
extern "C" void F77NAME(DGBCON)(_fcd,const int&, const int&, const int&,
double*, const int&, int*, double*,
double*,double*,int*,const int&);
extern "C" void F77NAME(SGBTRF)(const int&,const int&,const int&,const int&,
float*,const int&,int*,int&);
extern "C" void F77NAME(SGBTRS)(_fcd,const int&,const int&,const int&,
const int&,float*,const int&,int*,float*,
const int&,int&);
#else
extern "C" void F77NAME(dgbtrf)(const int&,const int&,const int&,const int&,
double*,const int&,int*,int&);
extern "C" void F77NAME(dgbtrs)(const char*,const int&,const int&,const int&,
const int&,double*,const int&,int*,double*,
const int&,int&);
extern "C" void F77NAME(dgbcon)(const char*,const int&, const int&, const int&,
double*, const int&, int*, double*,
double*,double*,int*,const int&);
extern "C" void F77NAME(sgbtrf)(const int&,const int&,const int&,const int&,
float*,const int&,int*,int&);
extern "C" void F77NAME(sgbtrs)(const char*,const int&,const int&,const int&,
const int&,float*,const int&,int*,float*,
const int&,int&);
#endif
class LaBandedDirectSolver : public LinearSolver
{
public:
LaBandedDirectSolver();
LaBandedDirectSolver(BandColMat& BCMin);
virtual ~LaBandedDirectSolver();
void attachMat(BandColMat& BCMin);
bool prepare();
bool solve(const Vec& bIn,Vec& xIn);
void printMatrices(const char* filename);
void calculateCondition(DataCollector& d);
private:
bool PRINT_MATRICES,CALCULATE_CONDITION;
std::ofstream matOut;
AttacheVec x;
int neq,kl,ku;
int LEAD_DIM_STORAGE,errorFlag;
real* arrayptr,*rwork;
int* pivotptr,*iwork;
BandColMat* BCM;
DataCollector* data;
};
}//Daetk
#endif