60 #include "utilitaires.h" 63 void get_legendre_data(
int, Tbl*&, Tbl*& ) ;
67 void cfrleg(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
85 cout <<
"cfrleg: nr > n3f : nr = " << nr <<
" , n3f = " 91 cout <<
"cfrleg: nr > n3c : nr = " << nr <<
" , n3c = " 97 cout <<
"cfrleg: n1f > n1c : n1f = " << n1f <<
" , n1c = " 103 cout <<
"cfrleg: n2f > n2c : n2f = " << n2f <<
" , n2c = " 111 get_legendre_data(nr, Pni, wn) ;
112 assert( (Pni != 0x0) && (wn != 0x0) ) ;
113 double* cf_tmp =
new double[nr] ;
117 int n2n3f = n2f * n3f ;
118 int n2n3c = n2c * n3c ;
126 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
128 for (
int j=0; j< borne_phi; j++) {
132 for (
int k=0; k<n2f; k++) {
134 int i0 = n2n3f * j + n3f * k ;
135 double* ff0 = ff + i0 ;
137 i0 = n2n3c * j + n3c * k ;
138 double* cf0 = cf + i0 ;
140 for (
int ii=0; ii<nr; ii++) {
142 for (
int jj = 0; jj<nr; jj++)
143 cf_tmp[ii] += ff0[jj] * (*wn)(jj) * (*Pni)(ii, jj) ;
144 cf_tmp[ii] /= double(2) / double(2*ii+1) ;
146 cf_tmp[nm1] /= double(nr+nm1) / double(nm1) ;
147 for (
int i=0; i<nr; i++)
156 void cfrlegp(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
174 cout <<
"cfrlegp: nr > n3f : nr = " << nr <<
" , n3f = " 180 cout <<
"cfrlegp: nr > n3c : nr = " << nr <<
" , n3c = " 186 cout <<
"cfrlegp: n1f > n1c : n1f = " << n1f <<
" , n1c = " 192 cout <<
"cfrlegp: n2f > n2c : n2f = " << n2f <<
" , n2c = " 200 int dnm1 = 2*nr - 1 ;
204 get_legendre_data(dnm1, Pni, wn) ;
205 double* cf_tmp =
new double[nr] ;
209 int n2n3f = n2f * n3f ;
210 int n2n3c = n2c * n3c ;
218 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
220 for (
int j=0; j< borne_phi; j++) {
224 for (
int k=0; k<n2f; k++) {
226 int i0 = n2n3f * j + n3f * k ;
227 double* ff0 = ff + i0 ;
229 i0 = n2n3c * j + n3c * k ;
230 double* cf0 = cf + i0 ;
232 for (
int ii=0; ii<nr; ii++) {
233 cf_tmp[ii] = 0.5*ff0[0]*(*Pni)(2*ii, nm1)
235 for (
int jj=1; jj<nr; jj++) {
236 cf_tmp[ii] += ff0[jj]* (*wn)(nm1+jj) * (*Pni)(2*ii, nm1+jj) ;
238 cf_tmp[ii] *= double(4*ii+1) ;
240 cf_tmp[nm1] /= double(4*nm1+1) / double(2*nm1) ;
241 for (
int i=0; i<nr; i++)
252 void cfrlegi(
const int* deg,
const int* dimf,
double* ff,
const int* dimc,
270 cout <<
"cfrlegi: nr > n3f : nr = " << nr <<
" , n3f = " 276 cout <<
"cfrlegi: nr > n3c : nr = " << nr <<
" , n3c = " 282 cout <<
"cfrlegi: n1f > n1c : n1f = " << n1f <<
" , n1c = " 288 cout <<
"cfrlegi: n2f > n2c : n2f = " << n2f <<
" , n2c = " 296 int dnm1 = 2*nr - 1 ;
300 get_legendre_data(dnm1, Pni, wn) ;
301 double* cf_tmp =
new double[nr] ;
302 double* gam_tmp =
new double[nr] ;
306 int n2n3f = n2f * n3f ;
307 int n2n3c = n2c * n3c ;
315 int borne_phi = ( n1f > 1 ) ? n1f-1 : 1 ;
317 for (
int j=0; j< borne_phi; j++) {
321 for (
int k=0; k<n2f; k++) {
323 int i0 = n2n3f * j + n3f * k ;
324 double* ff0 = ff + i0 ;
326 i0 = n2n3c * j + n3c * k ;
327 double* cf0 = cf + i0 ;
329 for (
int ii=0; ii<nr-1; ii++) {
330 cf_tmp[ii] = 0.5*ff0[0]*(*Pni)(2*ii+1, nm1)
333 for (
int jj=1; jj<nr; jj++) {
334 cf_tmp[ii] += ff0[jj]* (*wn)(nm1+jj) * (*Pni)(2*ii+1, nm1+jj) ;
335 gam_tmp[ii] += (*Pni)(2*ii+1, nm1+jj) * (*Pni)(2*ii+1, nm1+jj) * (*wn)(nm1+jj) ;
337 cf_tmp[ii] *= double(4*ii+3) ;
340 for (
int i=0; i<nr; i++)