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 char division_xpun_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/division_xpun.C,v 1.4 2014/10/13 08:53:23 j_novak Exp $" ;
24 
25 /*
26  * $Id: division_xpun.C,v 1.4 2014/10/13 08:53:23 j_novak Exp $
27  * $Log: division_xpun.C,v $
28  * Revision 1.4 2014/10/13 08:53:23 j_novak
29  * Lorene classes and functions now belong to the namespace Lorene.
30  *
31  * Revision 1.3 2014/10/06 15:16:06 j_novak
32  * Modified #include directives to use c++ syntax.
33  *
34  * Revision 1.2 2003/10/03 15:58:49 j_novak
35  * Cleaning of some headers
36  *
37  * Revision 1.1.1.1 2001/11/20 15:19:29 e_gourgoulhon
38  * LORENE
39  *
40  * Revision 1.3 2000/09/07 13:19:20 phil
41  * *** empty log message ***
42  *
43  * Revision 1.2 2000/06/06 12:23:12 phil
44  * suppression des fichiers include locaux
45  *
46  * Revision 1.1 2000/06/06 12:18:59 phil
47  * Initial revision
48  *
49  *
50  * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/division_xpun.C,v 1.4 2014/10/13 08:53:23 j_novak Exp $
51  *
52  */
53 
54 //standard
55 #include <cstdlib>
56 
57 // Lorene
58 #include "cmp.h"
59 #include "proto.h"
60 
61 namespace Lorene {
62 Cmp division_xpun (const Cmp& source, int num_front) {
63 
64  assert (source.get_etat() != ETATNONDEF) ;
65  Cmp resultat (source) ;
66 
67  if (resultat.get_etat() == ETATZERO)
68  return resultat ;
69  else {
70  resultat.va.coef() ;
71  resultat.va.set_etat_cf_qcq() ;
72  int base_r = source.va.base.b[num_front+1] & MSQ_R ;
73 
74  int nr = source.get_mp()->get_mg()->get_nr(num_front+1) ;
75  double* coef = new double[nr] ;
76 
77  for (int k=0 ; k<source.get_mp()->get_mg()->get_np(num_front+1)+1 ; k++)
78  if (k != 1)
79  for (int j=0 ; j<source.get_mp()->get_mg()->get_nt(num_front) ; j++) {
80  for (int i=0 ; i<nr ; i++)
81  coef[i] = (*resultat.va.c_cf)(num_front+1, k, j, i) ;
82  sxpun_1d (nr, &coef, base_r) ;
83  for (int i=0 ; i<nr ; i++)
84  resultat.va.c_cf->set(num_front+1, k, j, i) = coef[i] ;
85  }
86 
87  delete [] coef ;
88  return resultat ;
89  }
90 }
91 }
Lorene prototypes.
Definition: app_hor.h:64
#define MSQ_R
Extraction de l&#39;info sur R.
Definition: type_parite.h:152