source: Sophya/trunk/SophyaLib/Samba/lambdaBuilder.h@ 1683

Last change on this file since 1683 was 1683, checked in by lemeur, 24 years ago

methode iterative pour analyse harmonique

File size: 2.4 KB
Line 
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
9
10namespace SOPHYA {
11
12/*! classe pour les polynomes de legendre*/
13class Legendre {
14
15 public :
16Legendre();
17Legendre(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 }
24return 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
41LambdaLMBuilder() {}
42LambdaLMBuilder(r_8 theta,int_4 lmax, int_4 mmax);
43LambdaLMBuilder(r_8 ct, r_8 st,int_4 lmax, int_4 mmax);
44virtual ~LambdaLMBuilder() {};
45
46 /*! return the value of the coefficient \f$ \lambda_l^m \f$ */
47inline double lamlm(int l, int m) const { return lambda_(l,m); }
48
49inline 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
56 private:
57 void updateArrayRecurrence(int_4 lmax);
58
59 void array_init(int lmax, int mmax);
60
61
62 static TriangularMatrix<r_8>* a_recurrence_;
63 TriangularMatrix<r_8> lambda_;
64
65 protected :
66
67 void updateArrayLamNorm();
68
69 static TriangularMatrix<r_8>* lam_fact_;
70 static TVector<r_8>* normal_l_;
71 int_4 lmax_;
72 int_4 mmax_;
73 r_8 cth_;
74 r_8 sth_;
75
76 };
77
78
79
80class LambdaWXBuilder : public LambdaLMBuilder
81{
82 public:
83
84
85LambdaWXBuilder() {}
86
87LambdaWXBuilder(r_8 theta, int_4 lmax, int_4 mmax);
88
89 /*! return the value of the coefficients \f$ _{w}\lambda_l^m\f$ and \f$_{x}\lambda_l^m\f$ */
90inline void lam_wx(int l, int m, r_8& w, r_8& x) const
91 {
92 w=lamWlm_(l,m);
93 x=lamXlm_(l,m);
94 }
95
96 private:
97
98 void array_init();
99
100
101 TriangularMatrix<r_8> lamWlm_;
102 TriangularMatrix<r_8> lamXlm_;
103
104
105};
106
107class LambdaPMBuilder : public LambdaLMBuilder
108{
109 public:
110
111LambdaPMBuilder() {}
112
113 LambdaPMBuilder(r_8 theta, int_4 lmax, int_4 mmax);
114 /*! return the value of the coefficients \f$ _{+}\lambda_l^m\f$ and \f$_{-}\lambda_l^m\f$ */
115inline void lam_pm(int l, int m, r_8& lambda_plus, r_8& lambda_moins) const
116 {
117 lambda_plus = lamPlm_(l,m);
118 lambda_moins = lamMlm_(l,m);
119 }
120
121 private:
122 void array_init();
123
124 TriangularMatrix<r_8> lamPlm_;
125 TriangularMatrix<r_8> lamMlm_;
126
127};
128
129} // Fin du namespace
130
131#endif
Note: See TracBrowser for help on using the repository browser.