/* * Copyright (c) 1999-2001 Philippe Grandclement * Copyright (c) 1999-2001 Eric Gourgoulhon * Copyright (c) 2002 Jerome Novak * * This file is part of LORENE. * * LORENE is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * LORENE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LORENE; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ char tenseur_sym_operateur_C[] = "$Header: /cvsroot/Lorene/C++/Source/Tenseur/tenseur_sym_operateur.C,v 1.8 2014/10/13 08:53:43 j_novak Exp $" ; /* * $Id: tenseur_sym_operateur.C,v 1.8 2014/10/13 08:53:43 j_novak Exp $ * $Log: tenseur_sym_operateur.C,v $ * Revision 1.8 2014/10/13 08:53:43 j_novak * Lorene classes and functions now belong to the namespace Lorene. * * Revision 1.7 2014/10/06 15:13:19 j_novak * Modified #include directives to use c++ syntax. * * Revision 1.6 2003/03/03 19:41:34 f_limousin * Suppression of an assert on a metric associated with a tensor. * * Revision 1.5 2002/10/16 14:37:15 j_novak * Reorganization of #include instructions of standard C++, in order to * use experimental version 3 of gcc. * * Revision 1.4 2002/09/10 13:44:17 j_novak * The method "manipule" of one indice has been removed for Tenseur_sym objects * (the result cannot be a Tenseur_sym). * The method "sans_trace" now computes the traceless part of a Tenseur (or * Tenseur_sym) of valence 2. * * Revision 1.3 2002/09/06 14:49:26 j_novak * Added method lie_derive for Tenseur and Tenseur_sym. * Corrected various errors for derive_cov and arithmetic. * * Revision 1.2 2002/08/07 16:14:12 j_novak * class Tenseur can now also handle tensor densities, this should be transparent to older codes * * Revision 1.1.1.1 2001/11/20 15:19:30 e_gourgoulhon * LORENE * * Revision 2.2 2000/02/09 19:32:22 eric * MODIF IMPORTANTE: la triade de decomposition est desormais passee en * argument des constructeurs. * * Revision 2.1 2000/01/11 11:15:08 eric * Gestion de la base vectorielle (triad). * * Revision 2.0 1999/12/02 17:19:02 phil * *** empty log message *** * * * $Header: /cvsroot/Lorene/C++/Source/Tenseur/tenseur_sym_operateur.C,v 1.8 2014/10/13 08:53:43 j_novak Exp $ * */ // Headers C #include #include #include // Headers Lorene #include "tenseur.h" #include "metrique.h" namespace Lorene { Tenseur_sym operator*(const Tenseur& t1, const Tenseur_sym& t2) { assert ((t1.get_etat() != ETATNONDEF) && (t2.etat != ETATNONDEF)) ; assert (t1.get_mp() == t2.mp) ; int val_res = t1.get_valence() + t2.valence ; double poids_res = t1.get_poids() + t2.poids ; poids_res = (fabs(poids_res) < 1.e-10 ? 0. : poids_res) ; const Metrique* met_res = 0x0 ; if (poids_res != 0.) { // assert((t1.get_metric() != 0x0) || (t2.metric != 0x0)) ; if (t1.get_metric() != 0x0) met_res = t1.get_metric() ; else met_res = t2.metric ; } Itbl tipe (val_res) ; tipe.set_etat_qcq() ; for (int i=0 ; iidentify() == x.get_triad()->identify()) ; for (int i=0 ; i