ope_vorton_non_dege.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_vorton_non_dege_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_vorton/ope_vorton_non_dege.C,v 1.2 2007/04/24 15:52:55 p_grandclement Exp $" ;
00022 
00023 /*
00024  * $Id: ope_vorton_non_dege.C,v 1.2 2007/04/24 15:52:55 p_grandclement Exp $
00025  * $Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_vorton/ope_vorton_non_dege.C,v 1.2 2007/04/24 15:52:55 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         //-------------------
00035            //-- Pas prevu   ----
00036           //-------------------
00037 
00038 Matrice _vorton_non_dege_pas_prevu (const Matrice& so, int, int) {
00039   cout << "vorton non dege : not implemented" << endl ;
00040   abort() ;
00041   exit(-1) ;
00042   return so;
00043 }
00044 
00045         //-------------------
00046            //--  R_CHEB   ------
00047           //-------------------
00048 
00049 Matrice _vorton_non_dege_r_cheb (const Matrice& source, int, int) {
00050 
00051   int n = source.get_dim(0) ;
00052   int non_dege = 2 ;
00053   
00054   Matrice res(n-non_dege, n-non_dege) ;
00055   res.set_etat_qcq() ;
00056   for (int i=0 ; i<n-non_dege ; i++)
00057     for (int j=0 ; j<n-non_dege ; j++)
00058       res.set(i, j) = source(i, j+non_dege) ;
00059   
00060   res.set_band (2,2) ;
00061   res.set_lu() ;
00062   return res ;
00063 } 
00064 
00065 
00066             //-------------------
00067            //--  R_CHEBU   -----
00068           //-------------------
00069 Matrice _vorton_non_dege_r_chebu_trois (const Matrice &lap, int l) {
00070     
00071     int n = lap.get_dim(0) ;
00072     if (l==0) {
00073     Matrice res(n-1, n-1) ;
00074     res.set_etat_qcq() ;
00075     for (int i=0 ; i<n-1 ; i++)
00076         for (int j=0 ; j<n-1 ; j++)
00077         res.set(i, j) = lap(i, j+1) ;
00078     res.set_band(3, 0) ;
00079     res.set_lu() ;
00080     return res ;
00081     }
00082     else {
00083     Matrice res(n-2, n-2) ;
00084     res.set_etat_qcq() ;
00085     for (int i=0 ;i<n-2 ; i++)
00086         for (int j=0 ; j<n-2 ; j++)
00087         res.set(i, j) = lap(i, j+2) ;
00088     
00089     res.set_band(2, 1) ;
00090     res.set_lu() ;
00091     return res ;
00092     } 
00093 }         
00094 
00095 Matrice _vorton_non_dege_r_chebu (const Matrice &lap, int l, int puis) {
00096 
00097     switch (puis) {
00098     case 3 :
00099         return _vorton_non_dege_r_chebu_trois (lap, l) ;
00100     default :
00101         abort() ;
00102         exit(-1) ;
00103         return Matrice(0, 0) ;
00104     }
00105 }
00106 
00107 void Ope_vorton::do_non_dege() const {
00108   if (ope_cl == 0x0)
00109     do_ope_cl() ;
00110   
00111   if (non_dege != 0x0)
00112     delete non_dege ;
00113   
00114   // Routines de derivation
00115   static Matrice (*vorton_non_dege[MAX_BASE])(const Matrice&, int, int);
00116   static int nap = 0 ;
00117   
00118   // Premier appel
00119   if (nap==0) {
00120     nap = 1 ;
00121     for (int i=0 ; i<MAX_BASE ; i++) {
00122       vorton_non_dege[i] = _vorton_non_dege_pas_prevu ;
00123     }
00124     // Les routines existantes
00125     vorton_non_dege[R_CHEB >> TRA_R] = _vorton_non_dege_r_cheb ; 
00126     vorton_non_dege[R_CHEBU >> TRA_R] = _vorton_non_dege_r_chebu ;
00127   }
00128   non_dege = new Matrice(vorton_non_dege[base_r](*ope_cl, l_quant, dzpuis)) ;
00129 }

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