#ifndef IntfLapack_H_SEEN #define IntfLapack_H_SEEN #include "machdefs.h" #include "tarray.h" namespace SOPHYA { template class LapackServer { public: LapackServer(); virtual ~LapackServer(); virtual int LinSolve(TArray& a, TArray & b); virtual int SVD(TArray& a, TArray & s); virtual int SVD(TArray& a, TArray & s, TArray & u, TArray & vt); //! Set the workspace size factor for LAPACK routines inline void SetWorkSpaceSizeFactor(int f = 2) { wspace_size_factor = (f > 1) ? f : 1; } //! Returns the workspace size factor inline int GetWorkSpaceSizeFactor() { return wspace_size_factor; } private: int SVDDriver(TArray& a, TArray & s, TArray* up=NULL, TArray * vtp=NULL); int wspace_size_factor; }; /*! \ingroup LinAlg \fn LapackLinSolve(TArray&, TArray &) \brief Solves the linear system A*X = B using LapackServer. */ template inline int LapackLinSolve(TArray& a, TArray & b) { LapackServer lps; return( lps.LinSolve(a, b) ); } /*! \ingroup LinAlg \fn LapackSVD(TArray&, TArray &) \brief SVD decomposition using LapackServer. */ template inline int LapackSVD(TArray& a, TArray & s) { LapackServer lps; return( lps.SVD(a, s) ); } /*! \ingroup LinAlg \fn LapackSVD(TArray&, TArray &, TArray &, TArray &) \brief SVD decomposition using LapackServer. */ template inline int LapackSVD(TArray& a, TArray & s, TArray & u, TArray & vt) { LapackServer lps; return( lps.SVD(a, s, u, vt) ); } } // Fin du namespace #endif