00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 char ope_poisson_pseudo_1d_cl_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_poisson_pseudo_1d/ope_poisson_pseudo_1d_cl.C,v 1.1 2004/08/24 09:14:48 p_grandclement Exp $" ;
00022
00023
00024
00025
00026
00027
00028 #include <math.h>
00029 #include <stdlib.h>
00030
00031 #include "proto.h"
00032 #include "ope_elementary.h"
00033
00034
00035 Matrice _cl_poisson_pseudo_1d_pas_prevu (const Matrice & so) {
00036 cout << "Combinaison lineaire pas prevu..." << endl ;
00037 abort() ;
00038 exit(-1) ;
00039 return so;
00040 }
00041
00042
00043
00044
00045
00046
00047 Matrice _cl_poisson_pseudo_1d_r_cheb (const Matrice &source) {
00048
00049 int n = source.get_dim(0) ;
00050 assert (n == source.get_dim(1)) ;
00051
00052 Matrice barre(source) ;
00053 int dirac = 1 ;
00054 for (int i=0 ; i<n-2 ; i++) {
00055 for (int j=0 ; j<n ; j++)
00056 barre.set(i, j) = ((1+dirac)*source(i, j)-source(i+2, j))
00057 /(i+1) ;
00058 if (i==0) dirac = 0 ;
00059 }
00060
00061 Matrice res(barre) ;
00062 for (int i=0 ; i<n-4 ; i++)
00063 for (int j=0 ; j<n ; j++)
00064 res.set(i, j) = barre(i, j)-barre(i+2, j) ;
00065
00066 return res ;
00067 }
00068
00069
00070
00071
00072
00073
00074
00075 Matrice _cl_poisson_pseudo_1d_r_chebp (const Matrice &source) {
00076
00077 int n = source.get_dim(0) ;
00078 assert (n == source.get_dim(1)) ;
00079
00080 Matrice barre(source) ;
00081
00082 int dirac = 1 ;
00083 for (int i=0 ; i<n-2 ; i++) {
00084 for (int j=0 ; j<n ; j++)
00085 barre.set(i, j) = (1+dirac)*source(i, j)-source(i+2, j) ;
00086 if (i==0) dirac = 0 ;
00087 }
00088
00089 Matrice tilde(barre) ;
00090 for (int i=0 ; i<n-4 ; i++)
00091 for (int j=0 ; j<n ; j++)
00092 tilde.set(i, j) = barre(i, j)-barre(i+2, j) ;
00093
00094 Matrice res(tilde) ;
00095 for (int i=0 ; i<n-4 ; i++)
00096 for (int j=0 ; j<n ; j++)
00097 res.set(i, j) = tilde(i, j)-tilde(i+1, j) ;
00098
00099 return res ;
00100 }
00101
00102
00103
00104
00105
00106
00107 Matrice _cl_poisson_pseudo_1d_r_chebi (const Matrice &source) {
00108 int n = source.get_dim(0) ;
00109 assert (n == source.get_dim(1)) ;
00110
00111 Matrice barre(source) ;
00112
00113 for (int i=0 ; i<n-2 ; i++)
00114 for (int j=0 ; j<n ; j++)
00115 barre.set(i, j) = source(i, j)-source(i+2, j) ;
00116
00117 Matrice tilde(barre) ;
00118 for (int i=0 ; i<n-4 ; i++)
00119 for (int j=0 ; j<n ; j++)
00120 tilde.set(i, j) = barre(i, j)-barre(i+2, j) ;
00121
00122 Matrice res(tilde) ;
00123 for (int i=0 ; i<n-4 ; i++)
00124 for (int j=0 ; j<n ; j++)
00125 res.set(i, j) = tilde(i, j)-tilde(i+1, j) ;
00126
00127 return res ;
00128 }
00129
00130 void Ope_poisson_pseudo_1d::do_ope_cl() const {
00131 if (ope_mat == 0x0)
00132 do_ope_mat() ;
00133
00134 if (ope_cl != 0x0)
00135 delete ope_cl ;
00136
00137
00138 static Matrice (*cl_poisson_pseudo_1d[MAX_BASE])(const Matrice&);
00139 static int nap = 0 ;
00140
00141
00142 if (nap==0) {
00143 nap = 1 ;
00144 for (int i=0 ; i<MAX_BASE ; i++) {
00145 cl_poisson_pseudo_1d[i] = _cl_poisson_pseudo_1d_pas_prevu ;
00146 }
00147
00148 cl_poisson_pseudo_1d[R_CHEBP >> TRA_R] = _cl_poisson_pseudo_1d_r_chebp ;
00149 cl_poisson_pseudo_1d[R_CHEBI >> TRA_R] = _cl_poisson_pseudo_1d_r_chebi ;
00150 cl_poisson_pseudo_1d[R_CHEB >> TRA_R] = _cl_poisson_pseudo_1d_r_cheb ;
00151 }
00152 ope_cl = new Matrice(cl_poisson_pseudo_1d[base_r](*ope_mat)) ;
00153 }
00154
00155