ope_sec_order_r2_cl.C

00001 /*
00002  *   Copyright (c) 2003 Philippe Grandclement
00003  *
00004  *   This file is part of LORENE.
00005  *
00006  *   LORENE is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License version 2
00008  *   as published by the Free Software Foundation.
00009  *
00010  *   LORENE is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with LORENE; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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  * $Id: ope_sec_order_r2_cl.C,v 1.1 2004/03/05 09:22:24 p_grandclement Exp $
00025  * $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 $
00026  *
00027  */
00028 #include <math.h>
00029 #include <stdlib.h>
00030 
00031 #include "proto.h"
00032 #include "ope_elementary.h"
00033 
00034 // Version Matrice --> Matrice
00035 
00036         //-------------------
00037            //-- Pas prevu   ----
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            //--  R_CHEB   ------
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   // Routines de derivation
00082   static Matrice (*cl_sec_order_r2[MAX_BASE])(const Matrice&);
00083   static int nap = 0 ;
00084   
00085   // Premier appel
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     // Les routines existantes
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 

Generated on Tue Feb 7 01:35:18 2012 for LORENE by  doxygen 1.4.6