Changeset 3533 in Sophya for trunk


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

Location:
trunk/SophyaLib/Samba
Files:
3 edited

Legend:

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

    r3205 r3533  
    1010// #include "rancern.h"
    1111// #include "hbook.h"
    12 #ifdef OS_MACOSX
     12#ifdef Darwin
    1313#include <limits.h>
    1414#endif
  • 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
  • trunk/SophyaLib/Samba/lambdaBuilder.h

    r2958 r3533  
    66#include "tvector.h"
    77#include "alm.h"
     8#include "pexceptions.h"
    89
    910
    1011namespace SOPHYA {
    1112
    12 /*!  classe pour les polynomes de legendre*/
     13/*!  class of Legendre polynomials  */
    1314class Legendre {
     15public :
     16  Legendre(r_8 x, int_4 lmax);
    1417
    15  public :
    16 Legendre(r_8 x, int_4 lmax);
     18  inline r_8 getPl(int_4 l) const
     19  {
     20  if (l>lmax_)  {
     21    throw RangeCheckError("Legendre::getPl(l) l>lmax -> Instanciate class with greater lmax ...");
     22  }
     23  return Pl_(l);
     24  }
    1725
    18 inline r_8 getPl(int_4 l) const
    19 {
    20   if (l>lmax_)
    21     {
    22       throw (" illegal call of Legendre::getPl with index greater than lmax, which Legendre Class was instanciated with : instanciate Legendre with a greater lmax... ");
    23     }
    24 return Pl_(l);
    25 }
     26private :
     27  Legendre() {;}   // this is forbidden
    2628
    27 
    28  private :
    29 
    30 Legendre() {;}
    31 
    32 void array_init(int_4 lmax);
     29  void array_init(int_4 lmax);
    3330
    3431  r_8 x_;
     
    3936
    4037
    41  class LambdaLMBuilder {
     38class LambdaLMBuilder {
    4239
    43  public:
     40public:
    4441
    4542LambdaLMBuilder() {}
     
    103100
    104101
    105 
    106102class LambdaWXBuilder : public LambdaLMBuilder
    107103{
    108  public:
     104public:
    109105
    110106
Note: See TracChangeset for help on using the changeset viewer.