Overture  Version 25
TridiagonalSolver.h
Go to the documentation of this file.
1 #ifndef TRIDIAGONAL_SOLVER_H
2 #define TRIDIAGONAL_SOLVER_H
3 
4 #include "GenericDataBase.h"
5 #include "wdhdefs.h"
6 
8 {
9  public:
11  {
12  normal=0,
15  };
16 
19 
20  // factor a tri-diagonal system:
21  int factor( RealArray & a,
22  RealArray & b,
23  RealArray & c,
24  const SystemType & type=normal,
25  const int & axis=0,
26  const int & block=1 );
27 
28  // factor a penta-diagonal system:
29  int factor( RealArray & a,
30  RealArray & b,
31  RealArray & c,
32  RealArray & d,
33  RealArray & e,
34  const SystemType & type=normal,
35  const int & axis=0,
36  const int & block=1 );
37 
38  int solve( const RealArray & r, // this is not really const
39  const Range & R1=nullRange,
40  const Range & R2=nullRange,
41  const Range & R3=nullRange );
42 
43  virtual real sizeOf( FILE *file=NULL ) const ; // return number of bytes allocated, print info to a file
44 
45  protected:
46 
47  int tridiagonalFactor();
48  int tridiagonalSolve( RealArray & r );
51 
52  int invert(RealArray & d, const int & i1 );
53  int invert(RealArray & d, const Index & I1, const Index & I2, const Index & I3 );
54 
55  RealArray multiply( const RealArray & d, const int & i1, const RealArray & e, const int & j1);
56  RealArray matrixVectorMultiply( const RealArray & d, const int & i1, const RealArray & e, const int & j1);
57  RealArray matrixVectorMultiply( const RealArray & d, const int & i1, const RealArray & e);
58 
59  RealArray multiply(const RealArray & d, const Index & I1, const Index & I2, const Index & I3,
60  const RealArray & e, const Index & J1, const Index & J2, const Index & J3);
61  RealArray matrixVectorMultiply(const RealArray & d, const Index & I1, const Index & I2, const Index & I3,
62  RealArray & e, const Index & J1, const Index & J2, const Index & J3);
63 
64  int blockFactor();
65  int blockSolve(RealArray & r);
66  int blockPeriodicFactor();
68  int scalarBlockFactor(int i1, int i2, int i3 );
69  int scalarBlockSolve(RealArray & r, int i1, int i2, int i3);
70  int scalarBlockPeriodicFactor(int i1, int i2, int i3);
71  int scalarBlockPeriodicSolve(RealArray & r, int i1, int i2, int i3);
72 
74  int axis;
76  Range Iv[3], &I1, &I2, &I3;
77 
78  int blockSize; // we can do 1x1, 2x2 and 3x3 blocks
80  int bandWidth; // 3 or 5 for tridiagonal or penta-diagonal systems
81 
83 
84 };
85 
86 #endif