source: Sophya/trunk/SophyaExt/LinAlg/intflapack.h@ 1424

Last change on this file since 1424 was 1424, checked in by ansari, 25 years ago

MAJ documentation - Reza 23/2/2001

File size: 1.6 KB
Line 
1#ifndef IntfLapack_H_SEEN
2#define IntfLapack_H_SEEN
3
4#include "machdefs.h"
5#include "tarray.h"
6
7namespace SOPHYA {
8
9template <class T>
10class LapackServer {
11public:
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 //! Set the workspace size factor for LAPACK routines
20 inline void SetWorkSpaceSizeFactor(int f = 2)
21 { wspace_size_factor = (f > 1) ? f : 1; }
22
23 //! Returns the workspace size factor
24 inline int GetWorkSpaceSizeFactor()
25 { return wspace_size_factor; }
26
27private:
28 int SVDDriver(TArray<T>& a, TArray<T> & s,
29 TArray<T>* up=NULL, TArray<T> * vtp=NULL);
30
31 int wspace_size_factor;
32};
33
34/*! \ingroup LinAlg
35 \fn LapackLinSolve(TArray<T>&, TArray<T> &)
36 \brief Solves the linear system A*X = B using LapackServer.
37*/
38template <class T>
39inline int LapackLinSolve(TArray<T>& a, TArray<T> & b)
40{ LapackServer<T> lps; return( lps.LinSolve(a, b) ); }
41
42/*! \ingroup LinAlg
43 \fn LapackSVD(TArray<T>&, TArray<T> &)
44 \brief SVD decomposition using LapackServer.
45*/
46template <class T>
47inline int LapackSVD(TArray<T>& a, TArray<T> & s)
48{ LapackServer<T> lps; return( lps.SVD(a, s) ); }
49
50
51/*! \ingroup LinAlg
52 \fn LapackSVD(TArray<T>&, TArray<T> &, TArray<T> &, TArray<T> &)
53 \brief SVD decomposition using LapackServer.
54*/
55template <class T>
56inline int LapackSVD(TArray<T>& a, TArray<T> & s, TArray<T> & u, TArray<T> & vt)
57{ LapackServer<T> lps; return( lps.SVD(a, s, u, vt) ); }
58
59
60} // Fin du namespace
61
62#endif
Note: See TracBrowser for help on using the repository browser.