00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 char ope_sec_order_r2_cl_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_sec_order_r2/ope_sec_order_r2_cl.C,v 1.1 2004/03/05 09:22:24 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_sec_order_r2_pas_prevu (const Matrice& so) {
00041 cout << "CL Sec_order_r2 not implemented" << endl ;
00042 abort() ;
00043 exit(-1) ;
00044 return so;
00045 }
00046
00047
00048
00049
00050
00051 Matrice _cl_sec_order_r2_r_cheb (const Matrice& source) {
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
00070 return res ;
00071 }
00072
00073
00074 void Ope_sec_order_r2::do_ope_cl() const {
00075 if (ope_mat == 0x0)
00076 do_ope_mat() ;
00077
00078 if (ope_cl != 0x0)
00079 delete ope_cl ;
00080
00081
00082 static Matrice (*cl_sec_order_r2[MAX_BASE])(const Matrice&);
00083 static int nap = 0 ;
00084
00085
00086 if (nap==0) {
00087 nap = 1 ;
00088 for (int i=0 ; i<MAX_BASE ; i++) {
00089 cl_sec_order_r2[i] = _cl_sec_order_r2_pas_prevu ;
00090 }
00091
00092 cl_sec_order_r2[R_CHEB >> TRA_R] = _cl_sec_order_r2_r_cheb ;
00093 }
00094 ope_cl = new Matrice(cl_sec_order_r2[base_r](*ope_mat)) ;
00095 }
00096
00097