00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 char ope_vorton_cl_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_vorton/ope_vorton_cl.C,v 1.2 2007/04/24 15:52:55 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
00036
00037
00038
00039
00040 Matrice _cl_vorton_pas_prevu (const Matrice& so, int) {
00041 cout << "CL vorton not implemented" << endl ;
00042 abort() ;
00043 exit(-1) ;
00044 return so;
00045 }
00046
00047
00048
00049
00050
00051 Matrice _cl_vorton_r_cheb (const Matrice& source, int) {
00052
00053 int n = source.get_dim(0) ;
00054 assert (n==source.get_dim(1)) ;
00055
00056 Matrice barre(source) ;
00057 int dirac = 1 ;
00058 for (int i=0 ; i<n-2 ; i++) {
00059 for (int j=0 ; j<n ; j++)
00060 barre.set(i, j) = ((1+dirac)*source(i, j)-source(i+2, j))
00061 /(i+1) ;
00062 if (i==0) dirac = 0 ;
00063 }
00064
00065 Matrice res(barre) ;
00066 for (int i=0 ; i<n-4 ; i++)
00067 for (int j=0 ; j< n ; j++)
00068 res.set(i, j) = barre(i, j)-barre(i+2, j) ;
00069 return res ;
00070 }
00071
00072
00073
00074
00075
00076 Matrice _cl_vorton_r_chebu_trois (const Matrice &source) {
00077
00078 int n = source.get_dim(0) ;
00079 assert (n == source.get_dim(1)) ;
00080
00081 Matrice barre(source) ;
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 Matrice _cl_vorton_r_chebu (const Matrice &source, int puis) {
00103 int n = source.get_dim(0) ;
00104 assert (n == source.get_dim(1)) ;
00105
00106 Matrice res(n, n) ;
00107 res.set_etat_qcq() ;
00108
00109 switch (puis) {
00110 case 3 :
00111 res = _cl_vorton_r_chebu_trois(source) ;
00112 break ;
00113 default :
00114 abort() ;
00115 exit(-1) ;
00116 }
00117 return res ;
00118 }
00119
00120
00121 void Ope_vorton::do_ope_cl() const {
00122 if (ope_mat == 0x0)
00123 do_ope_mat() ;
00124
00125 if (ope_cl != 0x0)
00126 delete ope_cl ;
00127
00128
00129 static Matrice (*cl_vorton[MAX_BASE])(const Matrice&, int);
00130 static int nap = 0 ;
00131
00132
00133 if (nap==0) {
00134 nap = 1 ;
00135 for (int i=0 ; i<MAX_BASE ; i++) {
00136 cl_vorton[i] = _cl_vorton_pas_prevu ;
00137 }
00138
00139 cl_vorton[R_CHEB >> TRA_R] = _cl_vorton_r_cheb ;
00140 cl_vorton[R_CHEBU >> TRA_R] = _cl_vorton_r_chebu ;
00141 }
00142 ope_cl = new Matrice(cl_vorton[base_r](*ope_mat, dzpuis)) ;
00143 }
00144
00145