Changeset 1424 in Sophya


Ignore:
Timestamp:
Feb 23, 2001, 6:47:44 PM (25 years ago)
Author:
ansari
Message:

MAJ documentation - Reza 23/2/2001

Location:
trunk/SophyaExt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/IFFTW/fftwserver.cc

    r1405 r1424  
    22#include "FFTW/fftw.h"
    33#include "FFTW/rfftw.h"
     4
     5/*!
     6   \defgroup IFFTW IFFTW module
     7   Module containing interface classes between Sophya objects
     8   and FFTW Fourier transform package (see http://www.fftw.org )
     9*/
    410
    511/*!
  • trunk/SophyaExt/LinAlg/intflapack.cc

    r1344 r1424  
    44#include "tmatrix.h"
    55#include <typeinfo>
     6
     7/*!
     8   \defgroup LinAlg LinAlg module
     9   This module contains classes and functions for complex linear
     10   algebra on arrays. This module is intended mainly to have
     11   classes implementing C++ interfaces between Sophya objects
     12   and external linear algebra libraries, such as LAPACK. 
     13*/
     14
     15/*!
     16  \class SOPHYA::LapackServer
     17  \ingroup LinAlg
     18  This class implements an interface to LAPACK library driver routines.
     19  The LAPACK (Linear Algebra PACKage) is a collection high performance
     20  routines to solve common problems in numerical linear algebra.
     21  its is available from http://www.netlib.org.
     22 
     23  The present version of our LapackServer (Feb 2001) provides only
     24  interfaces for the linear system solver and singular value
     25  decomposition (SVD). Only arrays with BaseArray::FortranMemoryMapping
     26  can be handled by LapackServer. LapackServer can be instanciated
     27  for simple and double precision real or complex array types.
     28
     29  The example below shows solving a linear system A*X = B
     30
     31  \code
     32  #include "intflapack.h"
     33  // ...
     34  // Use FortranMemoryMapping as default
     35  BaseArray::SetDefaultMemoryMapping(BaseArray::FortranMemoryMapping);
     36  // Create an fill the arrays A and B
     37  int n = 20;
     38  Matrix A(n, n);
     39  A = RandomSequence();
     40  Vector X(n),B(n);
     41  X = RandomSequence();
     42  B = A*X;
     43  // Solve the linear system A*X = B
     44  LapackServer<r_8> lps;
     45  lps.LinSolve(A,B);
     46  // We get the result in B, which should be equal to X ...
     47  // Compute the difference B-X ;
     48  Vector diff = B-X;
     49  \endcode
     50
     51*/
    652
    753extern "C" {
     
    4692}
    4793
     94//! Interface to Lapack linear system solver driver s/d/c/zgesvd().
     95/*! Solve the linear system a * x = b. Input arrays
     96  should have FortranMemory mapping (column packed).
     97  \param a : input matrix, overwritten on output
     98  \param b : input-output, input vector b, contains x on exit
     99  \return : return code from lapack driver _gesv()
     100 */
    48101template <class T>
    49102int LapackServer<T>::LinSolve(TArray<T>& a, TArray<T> & b)
     
    91144}
    92145
     146//! Interface to Lapack SVD driver s/d/c/zgesv().
     147/*! Computes the vector of singular values of \b a. Input arrays
     148  should have FortranMemoryMapping (column packed).
     149  \param a : input m-by-n matrix
     150  \param s : Vector of min(m,n) singular values (descending order)
     151  \return : return code from lapack driver _gesvd()
     152 */
     153
    93154template <class T>
    94155int LapackServer<T>::SVD(TArray<T>& a, TArray<T> & s)
     
    97158}
    98159
     160//! Interface to Lapack SVD driver s/d/c/zgesv().
     161/*! Computes the vector of singular values of \b a, as well as
     162  right and left singular vectors of \b a.
     163  \f[
     164  A = U \Sigma V^T , ( A = U \Sigma V^H \ complex)
     165  \f]
     166  \f[
     167  A v_i = \sigma_i u_i \ and A^T u_i = \sigma_i v_i \ (A^H \ complex)
     168  \f]
     169  U and V are orthogonal (unitary) matrices.
     170  \param a : input m-by-n matrix (in FotranMemoryMapping)
     171  \param s : Vector of min(m,n) singular values (descending order)
     172  \param u : Matrix of left singular vectors
     173  \param vt : Transpose of right singular vectors.
     174  \return : return code from lapack driver _gesvd()
     175 */
    99176template <class T>
    100177int LapackServer<T>::SVD(TArray<T>& a, TArray<T> & s, TArray<T> & u, TArray<T> & vt)
     
    103180}
    104181
     182
     183//! Interface to Lapack SVD driver s/d/c/zgesv().
    105184template <class T>
    106185int LapackServer<T>::SVDDriver(TArray<T>& a, TArray<T> & s, TArray<T>* up, TArray<T>* vtp)
  • trunk/SophyaExt/LinAlg/intflapack.h

    r1342 r1424  
    1717  virtual int SVD(TArray<T>& a, TArray<T> & s, TArray<T> & u, TArray<T> & vt);
    1818
     19  //! Set the workspace size factor for LAPACK routines
    1920  inline void SetWorkSpaceSizeFactor(int f = 2)
    2021  { wspace_size_factor = (f > 1) ? f : 1; }
     22
     23  //! Returns the workspace size factor
    2124  inline int  GetWorkSpaceSizeFactor()
    2225  { return wspace_size_factor; }
     
    2932};
    3033
     34/*! \ingroup LinAlg
     35    \fn LapackLinSolve(TArray<T>&, TArray<T> &)
     36    \brief Solves the linear system A*X = B using LapackServer.
     37*/
    3138template <class T>
    3239inline int LapackLinSolve(TArray<T>& a, TArray<T> & b)
    3340{ LapackServer<T> lps; return( lps.LinSolve(a, b) );  }
    3441
     42/*! \ingroup LinAlg
     43    \fn LapackSVD(TArray<T>&, TArray<T> &)
     44    \brief SVD decomposition using LapackServer.
     45*/
    3546template <class T>
    3647inline int LapackSVD(TArray<T>& a, TArray<T> & s)
    3748{ LapackServer<T> lps; return( lps.SVD(a, s) ); }
    3849
     50
     51/*! \ingroup LinAlg
     52    \fn LapackSVD(TArray<T>&, TArray<T> &, TArray<T> &, TArray<T> &)
     53    \brief SVD decomposition using LapackServer.
     54*/
    3955template <class T>
    4056inline int LapackSVD(TArray<T>& a, TArray<T> & s, TArray<T> & u, TArray<T> & vt)
     
    4460} // Fin du namespace
    4561
    46 void rztest_lapack(TArray<r_4>& a, TArray<r_4>& b);
    47 
    4862#endif
Note: See TracChangeset for help on using the changeset viewer.