Ignore:
Timestamp:
Oct 12, 2008, 7:11:59 PM (17 years ago)
Author:
ansari
Message:

Adapation suite suppression flag OS_MACOSX, OS_LINUX + modifs cosmetiques lambdaBuilder.h .cc Reza 12/10/2008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Samba/lambdaBuilder.cc

    r2966 r3533  
    66/*!
    77  \class SOPHYA::Legendre
    8 generate Legendre polynomials : use in two steps :
    9 
    10 a) instanciate Legendre(\f$x\f$, \f$lmax\f$) ; \f$x\f$ is the value for wich Legendre polynomials will be required (usually equal to \f$\cos \theta\f$) and \f$lmax\f$ is the MAXIMUM value of the order of polynomials wich will be required in the following code (all polynomials, from \f$l=0 to lmax\f$, are computed once for all by an iterative formula).
    11 
    12 b) get the value of Legendre polynomial for a particular value of \f$l\f$ by calling the method getPl.
    13 
    14 */
    15 
    16 
     8  \ingroup Samba
     9
     10 Generate Legendre polynomials. The class usage can be summarized  in two steps as follows:
     11
     12  a) instanciate Legendre(\f$x\f$, \f$lmax\f$) ; \f$x\f$ is the value for wich Legendre
     13  polynomials will be required (usually equal to \f$\cos \theta\f$) and \f$lmax\f$ is
     14  the MAXIMUM value of the order of polynomials wich will be required.
     15  (All polynomials, from \f$l=0 to lmax\f$, are computed once for all by an recursive formula).
     16
     17  b) get the value of Legendre polynomial for a particular value of \f$l\f$ by calling the
     18  method getPl.
     19
     20*/
     21
     22/*! Constructor, with specification of \b lmax and the \b x value for the polynomials */
    1723Legendre::Legendre(r_8 x, int_4 lmax)
    1824{
    19   if (fabs(x) > 1. )
    20     {
    21       throw RangeCheckError("variable for Legendre polynomials must have modules inferior to 1" );
    22     }
     25  if (fabs(x) > 1. ) {
     26    throw RangeCheckError("Legendre::Legendre(x,lmax)  invalid x argument, fabs(x) > 1 !" );
     27  }
    2328  x_ = x;
    2429  array_init(lmax);
    2530}
    2631   
    27 /*! \fn void SOPHYA::Legendre::array_init(int_4 lmax)
    28 
    29 compute all \f$P_l(x,l_{max})\f$ for \f$l=1,l_{max}\f$
    30 */
     32/*! Private method which computes all \f$P_l(x,l_{max})\f$ for \f$l=1,l_{max}\f$ */
    3133void Legendre::array_init(int_4 lmax)
    3234{
     
    3537  Pl_(0)=1.;
    3638  if (lmax>0) Pl_(1)=x_;
    37   for (int k=2; k<Pl_.NElts(); k++)
    38     {
     39  for (int k=2; k<Pl_.NElts(); k++) {
    3940      Pl_(k) = ( (2.*k-1)*x_*Pl_(k-1)-(k-1)*Pl_(k-2) )/k;
    40     }
     41  }
    4142}
    4243
Note: See TracChangeset for help on using the changeset viewer.