[729] | 1 | #ifndef LAMBDABUILDER_SEEN
|
---|
| 2 | #define LAMBDABUILDER_SEEN
|
---|
| 3 |
|
---|
| 4 | #include <math.h>
|
---|
| 5 | #include "ndatablock.h"
|
---|
| 6 | #include "tvector.h"
|
---|
| 7 | #include "alm.h"
|
---|
| 8 |
|
---|
[864] | 9 |
|
---|
| 10 | namespace SOPHYA {
|
---|
| 11 |
|
---|
[1218] | 12 | /*! classe pour les polynomes de legendre*/
|
---|
[729] | 13 | class Legendre {
|
---|
| 14 |
|
---|
| 15 | public :
|
---|
| 16 | Legendre();
|
---|
| 17 | Legendre(r_8 x, int_4 lmax);
|
---|
| 18 | inline r_8 getPl(int_4 l)
|
---|
| 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 | }
|
---|
| 26 |
|
---|
| 27 | private :
|
---|
| 28 | void array_init(int_4 lmax);
|
---|
| 29 |
|
---|
| 30 | r_8 x_;
|
---|
| 31 | int_4 lmax_;
|
---|
| 32 | TVector<r_8> Pl_;
|
---|
| 33 | };
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | class LambdaLMBuilder {
|
---|
| 38 |
|
---|
| 39 | public:
|
---|
| 40 |
|
---|
| 41 | LambdaLMBuilder() {}
|
---|
| 42 | LambdaLMBuilder(r_8 theta,int_4 lmax, int_4 mmax);
|
---|
[1683] | 43 | LambdaLMBuilder(r_8 ct, r_8 st,int_4 lmax, int_4 mmax);
|
---|
[864] | 44 | virtual ~LambdaLMBuilder() {};
|
---|
[729] | 45 |
|
---|
| 46 | /*! return the value of the coefficient \f$ \lambda_l^m \f$ */
|
---|
| 47 | inline double lamlm(int l, int m) const { return lambda_(l,m); }
|
---|
| 48 |
|
---|
[1683] | 49 | inline double lamlm(int index) const { return lambda_(index); }
|
---|
| 50 |
|
---|
| 51 |
|
---|
| 52 | //Return pointer to first element address of the alm's
|
---|
| 53 | //inline r_8* Data() {return lambda_.Data();}
|
---|
| 54 |
|
---|
| 55 |
|
---|
[729] | 56 | private:
|
---|
| 57 | void updateArrayRecurrence(int_4 lmax);
|
---|
| 58 |
|
---|
| 59 | void array_init(int lmax, int mmax);
|
---|
| 60 |
|
---|
| 61 |
|
---|
[1756] | 62 | // static TriangularMatrix<r_8>* a_recurrence_;
|
---|
| 63 | static TriangularMatrix<r_8> a_recurrence_;
|
---|
[729] | 64 | TriangularMatrix<r_8> lambda_;
|
---|
| 65 |
|
---|
| 66 | protected :
|
---|
| 67 |
|
---|
| 68 | void updateArrayLamNorm();
|
---|
| 69 |
|
---|
[1756] | 70 | // static TriangularMatrix<r_8>* lam_fact_;
|
---|
| 71 | static TriangularMatrix<r_8> lam_fact_;
|
---|
[729] | 72 | static TVector<r_8>* normal_l_;
|
---|
| 73 | int_4 lmax_;
|
---|
| 74 | int_4 mmax_;
|
---|
| 75 | r_8 cth_;
|
---|
| 76 | r_8 sth_;
|
---|
| 77 |
|
---|
| 78 | };
|
---|
| 79 |
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 | class LambdaWXBuilder : public LambdaLMBuilder
|
---|
| 83 | {
|
---|
| 84 | public:
|
---|
| 85 |
|
---|
| 86 |
|
---|
| 87 | LambdaWXBuilder() {}
|
---|
| 88 |
|
---|
| 89 | LambdaWXBuilder(r_8 theta, int_4 lmax, int_4 mmax);
|
---|
| 90 |
|
---|
| 91 | /*! return the value of the coefficients \f$ _{w}\lambda_l^m\f$ and \f$_{x}\lambda_l^m\f$ */
|
---|
| 92 | inline void lam_wx(int l, int m, r_8& w, r_8& x) const
|
---|
| 93 | {
|
---|
| 94 | w=lamWlm_(l,m);
|
---|
| 95 | x=lamXlm_(l,m);
|
---|
| 96 | }
|
---|
| 97 |
|
---|
| 98 | private:
|
---|
| 99 |
|
---|
| 100 | void array_init();
|
---|
| 101 |
|
---|
| 102 |
|
---|
| 103 | TriangularMatrix<r_8> lamWlm_;
|
---|
| 104 | TriangularMatrix<r_8> lamXlm_;
|
---|
| 105 |
|
---|
| 106 |
|
---|
| 107 | };
|
---|
| 108 |
|
---|
| 109 | class LambdaPMBuilder : public LambdaLMBuilder
|
---|
| 110 | {
|
---|
| 111 | public:
|
---|
| 112 |
|
---|
| 113 | LambdaPMBuilder() {}
|
---|
| 114 |
|
---|
| 115 | LambdaPMBuilder(r_8 theta, int_4 lmax, int_4 mmax);
|
---|
| 116 | /*! return the value of the coefficients \f$ _{+}\lambda_l^m\f$ and \f$_{-}\lambda_l^m\f$ */
|
---|
| 117 | inline void lam_pm(int l, int m, r_8& lambda_plus, r_8& lambda_moins) const
|
---|
| 118 | {
|
---|
| 119 | lambda_plus = lamPlm_(l,m);
|
---|
| 120 | lambda_moins = lamMlm_(l,m);
|
---|
| 121 | }
|
---|
| 122 |
|
---|
| 123 | private:
|
---|
| 124 | void array_init();
|
---|
| 125 |
|
---|
| 126 | TriangularMatrix<r_8> lamPlm_;
|
---|
| 127 | TriangularMatrix<r_8> lamMlm_;
|
---|
| 128 |
|
---|
[864] | 129 | };
|
---|
[729] | 130 |
|
---|
[864] | 131 | } // Fin du namespace
|
---|
[729] | 132 |
|
---|
| 133 | #endif
|
---|