1 | #ifndef IntfLapack_H_SEEN
|
---|
2 | #define IntfLapack_H_SEEN
|
---|
3 |
|
---|
4 | #include "machdefs.h"
|
---|
5 | #include "tarray.h"
|
---|
6 |
|
---|
7 | namespace SOPHYA {
|
---|
8 |
|
---|
9 | template <class T>
|
---|
10 | class LapackServer {
|
---|
11 | public:
|
---|
12 | LapackServer();
|
---|
13 | virtual ~LapackServer();
|
---|
14 |
|
---|
15 | virtual int LinSolve(TArray<T>& a, TArray<T> & b);
|
---|
16 | virtual int SVD(TArray<T>& a, TArray<T> & s);
|
---|
17 | virtual int SVD(TArray<T>& a, TArray<T> & s, TArray<T> & u, TArray<T> & vt);
|
---|
18 |
|
---|
19 | inline void SetWorkSpaceSizeFactor(int f = 2)
|
---|
20 | { wspace_size_factor = (f > 1) ? f : 1; }
|
---|
21 | inline int GetWorkSpaceSizeFactor()
|
---|
22 | { return wspace_size_factor; }
|
---|
23 |
|
---|
24 | private:
|
---|
25 | int SVDDriver(TArray<T>& a, TArray<T> & s,
|
---|
26 | TArray<T>* up=NULL, TArray<T> * vtp=NULL);
|
---|
27 |
|
---|
28 | int wspace_size_factor;
|
---|
29 | };
|
---|
30 |
|
---|
31 | template <class T>
|
---|
32 | inline int LapackLinSolve(TArray<T>& a, TArray<T> & b)
|
---|
33 | { LapackServer<T> lps; return( lps.LinSolve(a, b) ); }
|
---|
34 |
|
---|
35 | template <class T>
|
---|
36 | inline int LapackSVD(TArray<T>& a, TArray<T> & s)
|
---|
37 | { LapackServer<T> lps; return( lps.SVD(a, s) ); }
|
---|
38 |
|
---|
39 | template <class T>
|
---|
40 | inline int LapackSVD(TArray<T>& a, TArray<T> & s, TArray<T> & u, TArray<T> & vt)
|
---|
41 | { LapackServer<T> lps; return( lps.SVD(a, s, u, vt) ); }
|
---|
42 |
|
---|
43 |
|
---|
44 | } // Fin du namespace
|
---|
45 |
|
---|
46 | void rztest_lapack(TArray<r_4>& a, TArray<r_4>& b);
|
---|
47 |
|
---|
48 | #endif
|
---|