Changeset 1566 in Sophya for trunk/SophyaExt


Ignore:
Timestamp:
Jul 5, 2001, 5:45:50 PM (24 years ago)
Author:
ansari
Message:

Ajout commentaires-documentation ds LapackServer::LeastSquareSolve() - Reza 5/7/2001

Location:
trunk/SophyaExt/LinAlg
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/LinAlg/intflapack.cc

    r1494 r1566  
    154154}
    155155
     156//! Interface to Lapack least squares solver driver s/d/c/zgels().
     157/*! Solves the linear least squares problem defined by an m-by-n matrix
     158  \b a and an m element vector \b b .
     159  A solution \b x to the overdetermined system of linear equations
     160  b = a * x is computed, minimizing the norm of b-a*x.
     161  Underdetermined systems (m<n) are not yet handled.
     162  Inout arrays should have FortranMemory mapping (column packed).
     163  \param a : input matrix, overwritten on output
     164  \param b : input-output, input vector b, contains x on exit.
     165  \return : return code from lapack driver _gels()
     166  \warning : b is not resized.
     167 */
     168/*
     169  $CHECK$ - A faire - cas m<n
     170       If the linear system is underdetermined, the minimum norm
     171       solution is computed.
     172*/
     173
    156174template <class T>
    157175int LapackServer<T>::LeastSquareSolve(TArray<T>& a, TArray<T> & b)
     
    170188
    171189  if (!a.IsPacked(rowa) || !b.IsPacked(rowb))
    172      throw(SzMismatchError("LapackServer::LinSolve(a,b) a Or b Not Column Packed"));
    173 
    174   if ( a.Size(rowa) <  a.Size(cola))
    175     throw(SzMismatchError("LapackServer::LeastSquareSolve(a,b) NRows<NCols "));
    176 
     190     throw(SzMismatchError("LapackServer::LeastSquareSolve(a,b) a Or b Not Column Packed"));
     191
     192  if ( a.Size(rowa) <  a.Size(cola)) {  // $CHECK$ - m<n a changer
     193    cout << " LapackServer<T>::LeastSquareSolve() - m<n - Not yet implemented for "
     194         << " underdetermined systems ! " << endl;
     195    throw(SzMismatchError("LapackServer::LeastSquareSolve(a,b) NRows<NCols - "));
     196  }
    177197  int_4 m = a.Size(rowa);
    178198  int_4 n = a.Size(cola);
  • trunk/SophyaExt/LinAlg/intflapack.h

    r1494 r1566  
    4242{ LapackServer<T> lps; return( lps.LinSolve(a, b) );  }
    4343
     44/*! \ingroup LinAlg
     45    \fn LapackLeastSquareSolve(TArray<T>&, TArray<T> &)
     46    \brief Solves the linear least squares problem A*X - B
     47*/
    4448template <class T>
    4549inline int LapackLeastSquareSolve(TArray<T>& a, TArray<T> & b)
Note: See TracChangeset for help on using the changeset viewer.