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

Last change on this file since 1218 was 1218, checked in by ansari, 25 years ago

doc dans .cc

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