LORENE
ope_sec_order_non_dege.C
1 /*
2  * Copyright (c) 2003 Philippe Grandclement
3  *
4  * This file is part of LORENE.
5  *
6  * LORENE is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2
8  * as published by the Free Software Foundation.
9  *
10  * LORENE is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with LORENE; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  */
20 
21 char ope_sec_order_non_dege_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_sec_order/ope_sec_order_non_dege.C,v 1.3 2014/10/13 08:53:36 j_novak Exp $" ;
22 
23 /*
24  * $Id: ope_sec_order_non_dege.C,v 1.3 2014/10/13 08:53:36 j_novak Exp $
25  * $Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_sec_order/ope_sec_order_non_dege.C,v 1.3 2014/10/13 08:53:36 j_novak Exp $
26  *
27  */
28 #include <cmath>
29 #include <cstdlib>
30 
31 #include "proto.h"
32 #include "ope_elementary.h"
33 
34  //-------------------
35  //-- Pas prevu ----
36  //-------------------
37 
38 namespace Lorene {
39 Matrice _sec_order_non_dege_pas_prevu (const Matrice& so) {
40  cout << "Sec_order non dege : not implemented" << endl ;
41  abort() ;
42  exit(-1) ;
43  return so;
44 }
45 
46  //-------------------
47  //-- R_CHEB ------
48  //-------------------
49 
50 Matrice _sec_order_non_dege_r_cheb (const Matrice& source) {
51 
52  int n = source.get_dim(0) ;
53  int non_dege = 2 ;
54 
55  Matrice res(n-non_dege, n-non_dege) ;
56  res.set_etat_qcq() ;
57  for (int i=0 ; i<n-non_dege ; i++)
58  for (int j=0 ; j<n-non_dege ; j++)
59  res.set(i, j) = source(i, j+non_dege) ;
60 
61  res.set_band (2,2) ;
62  res.set_lu() ;
63  return res ;
64 }
65 
66 
68  if (ope_cl == 0x0)
69  do_ope_cl() ;
70 
71  if (non_dege != 0x0)
72  delete non_dege ;
73 
74  // Routines de derivation
75  static Matrice (*sec_order_non_dege[MAX_BASE])(const Matrice&);
76  static int nap = 0 ;
77 
78  // Premier appel
79  if (nap==0) {
80  nap = 1 ;
81  for (int i=0 ; i<MAX_BASE ; i++) {
82  sec_order_non_dege[i] = _sec_order_non_dege_pas_prevu ;
83  }
84  // Les routines existantes
85  sec_order_non_dege[R_CHEB >> TRA_R] = _sec_order_non_dege_r_cheb ;
86  }
87  non_dege = new Matrice(sec_order_non_dege[base_r](*ope_cl)) ;
88 }
89 }
Lorene::Ope_sec_order::do_ope_cl
virtual void do_ope_cl() const
Computes the banded-matrix of the operator.
Definition: ope_sec_order_cl.C:75
Lorene::Ope_elementary::ope_cl
Matrice * ope_cl
Pointer on the banded-matrix of the operator.
Definition: ope_elementary.h:118
R_CHEB
#define R_CHEB
base de Chebychev ordinaire (fin)
Definition: type_parite.h:166
Lorene::Ope_sec_order::do_non_dege
virtual void do_non_dege() const
Computes the non-degenerated matrix of the operator.
Definition: ope_sec_order_non_dege.C:67
Lorene
Lorene prototypes.
Definition: app_hor.h:64
Lorene::Ope_elementary::base_r
int base_r
Radial basis of decomposition.
Definition: ope_elementary.h:107
TRA_R
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
Definition: type_parite.h:158
Lorene::Matrice
Matrix handling.
Definition: matrice.h:152
Lorene::Matrice::get_dim
int get_dim(int i) const
Returns the dimension of the matrix.
Definition: matrice.C:260
MAX_BASE
#define MAX_BASE
Nombre max. de bases differentes.
Definition: type_parite.h:144
Lorene::Ope_elementary::non_dege
Matrice * non_dege
Pointer on the non-degenerated matrix of the operator.
Definition: ope_elementary.h:122