division_xpun.C

00001 /*
00002  *   Copyright (c) 2000-2001 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 as published by
00008  *   the Free Software Foundation; either version 2 of the License, or
00009  *   (at your option) any later version.
00010  *
00011  *   LORENE is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License
00017  *   along with LORENE; if not, write to the Free Software
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 
00023 char division_xpun_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/division_xpun.C,v 1.2 2003/10/03 15:58:49 j_novak Exp $" ;
00024 
00025 /*
00026  * $Id: division_xpun.C,v 1.2 2003/10/03 15:58:49 j_novak Exp $
00027  * $Log: division_xpun.C,v $
00028  * Revision 1.2  2003/10/03 15:58:49  j_novak
00029  * Cleaning of some headers
00030  *
00031  * Revision 1.1.1.1  2001/11/20 15:19:29  e_gourgoulhon
00032  * LORENE
00033  *
00034  * Revision 1.3  2000/09/07  13:19:20  phil
00035  * *** empty log message ***
00036  *
00037  * Revision 1.2  2000/06/06  12:23:12  phil
00038  * suppression des fichiers include locaux
00039  *
00040  * Revision 1.1  2000/06/06  12:18:59  phil
00041  * Initial revision
00042  *
00043  *
00044  * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/division_xpun.C,v 1.2 2003/10/03 15:58:49 j_novak Exp $
00045  *
00046  */
00047 
00048 //standard
00049 #include <stdlib.h>
00050 
00051 // Lorene
00052 #include "cmp.h"
00053 #include "proto.h"
00054 
00055 Cmp division_xpun (const Cmp& source, int num_front) {
00056     
00057     assert (source.get_etat() != ETATNONDEF) ;
00058     Cmp resultat (source) ;
00059    
00060     if (resultat.get_etat() == ETATZERO)
00061     return resultat ;
00062     else  {
00063     resultat.va.coef() ;
00064     resultat.va.set_etat_cf_qcq() ;
00065     int base_r = source.va.base.b[num_front+1] & MSQ_R ;
00066     
00067     int nr = source.get_mp()->get_mg()->get_nr(num_front+1)  ;
00068     double* coef = new double[nr] ;
00069     
00070     for (int k=0 ; k<source.get_mp()->get_mg()->get_np(num_front+1)+1 ; k++)
00071         if (k != 1)
00072         for (int j=0 ; j<source.get_mp()->get_mg()->get_nt(num_front) ; j++) {
00073             for (int i=0 ; i<nr ; i++)
00074             coef[i] = (*resultat.va.c_cf)(num_front+1, k, j, i) ;
00075             sxpun_1d (nr, &coef, base_r) ;
00076             for (int i=0 ; i<nr ; i++)
00077             resultat.va.c_cf->set(num_front+1, k, j, i) = coef[i] ;
00078         }
00079     
00080     delete [] coef ;
00081     return resultat ;
00082     }
00083 }

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