LORENE
division_xpun.C
1 /*
2  * Copyright (c) 2000-2001 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 as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * LORENE is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with LORENE; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 
23 
24 
25 /*
26  * $Id: division_xpun.C,v 1.5 2016/12/05 16:18:07 j_novak Exp $
27  * $Log: division_xpun.C,v $
28  * Revision 1.5 2016/12/05 16:18:07 j_novak
29  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
30  *
31  * Revision 1.4 2014/10/13 08:53:23 j_novak
32  * Lorene classes and functions now belong to the namespace Lorene.
33  *
34  * Revision 1.3 2014/10/06 15:16:06 j_novak
35  * Modified #include directives to use c++ syntax.
36  *
37  * Revision 1.2 2003/10/03 15:58:49 j_novak
38  * Cleaning of some headers
39  *
40  * Revision 1.1.1.1 2001/11/20 15:19:29 e_gourgoulhon
41  * LORENE
42  *
43  * Revision 1.3 2000/09/07 13:19:20 phil
44  * *** empty log message ***
45  *
46  * Revision 1.2 2000/06/06 12:23:12 phil
47  * suppression des fichiers include locaux
48  *
49  * Revision 1.1 2000/06/06 12:18:59 phil
50  * Initial revision
51  *
52  *
53  * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/division_xpun.C,v 1.5 2016/12/05 16:18:07 j_novak Exp $
54  *
55  */
56 
57 //standard
58 #include <cstdlib>
59 
60 // Lorene
61 #include "cmp.h"
62 #include "proto.h"
63 
64 namespace Lorene {
65 Cmp division_xpun (const Cmp& source, int num_front) {
66 
67  assert (source.get_etat() != ETATNONDEF) ;
68  Cmp resultat (source) ;
69 
70  if (resultat.get_etat() == ETATZERO)
71  return resultat ;
72  else {
73  resultat.va.coef() ;
74  resultat.va.set_etat_cf_qcq() ;
75  int base_r = source.va.base.b[num_front+1] & MSQ_R ;
76 
77  int nr = source.get_mp()->get_mg()->get_nr(num_front+1) ;
78  double* coef = new double[nr] ;
79 
80  for (int k=0 ; k<source.get_mp()->get_mg()->get_np(num_front+1)+1 ; k++)
81  if (k != 1)
82  for (int j=0 ; j<source.get_mp()->get_mg()->get_nt(num_front) ; j++) {
83  for (int i=0 ; i<nr ; i++)
84  coef[i] = (*resultat.va.c_cf)(num_front+1, k, j, i) ;
85  sxpun_1d (nr, &coef, base_r) ;
86  for (int i=0 ; i<nr ; i++)
87  resultat.va.c_cf->set(num_front+1, k, j, i) = coef[i] ;
88  }
89 
90  delete [] coef ;
91  return resultat ;
92  }
93 }
94 }
Lorene prototypes.
Definition: app_hor.h:67
#define MSQ_R
Extraction de l&#39;info sur R.
Definition: type_parite.h:152