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
RevLine 
[775]1#ifndef IntfLapack_H_SEEN
2#define IntfLapack_H_SEEN
3
4#include "machdefs.h"
5#include "tarray.h"
6
[814]7namespace SOPHYA {
[775]8
[814]9template <class T>
10class LapackServer {
11public:
[1342]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
[1424]19 //! Set the workspace size factor for LAPACK routines
[1342]20 inline void SetWorkSpaceSizeFactor(int f = 2)
21 { wspace_size_factor = (f > 1) ? f : 1; }
[1424]22
23 //! Returns the workspace size factor
[1342]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;
[814]32};
33
[1424]34/*! \ingroup LinAlg
35 \fn LapackLinSolve(TArray<T>&, TArray<T> &)
36 \brief Solves the linear system A*X = B using LapackServer.
37*/
[814]38template <class T>
[1042]39inline int LapackLinSolve(TArray<T>& a, TArray<T> & b)
[1342]40{ LapackServer<T> lps; return( lps.LinSolve(a, b) ); }
[814]41
[1424]42/*! \ingroup LinAlg
43 \fn LapackSVD(TArray<T>&, TArray<T> &)
44 \brief SVD decomposition using LapackServer.
45*/
[1342]46template <class T>
47inline int LapackSVD(TArray<T>& a, TArray<T> & s)
48{ LapackServer<T> lps; return( lps.SVD(a, s) ); }
[814]49
[1424]50
51/*! \ingroup LinAlg
52 \fn LapackSVD(TArray<T>&, TArray<T> &, TArray<T> &, TArray<T> &)
53 \brief SVD decomposition using LapackServer.
54*/
[1342]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
[814]60} // Fin du namespace
61
[775]62#endif
Note: See TracBrowser for help on using the repository browser.