X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fsimp_lor.cpp;h=a102b74e4d3a36abe4b9852c0384e39e5a43acfd;hp=32d05b0c9d0ed7154b4d54a4953a63f321d0ec5b;hb=afdd7fa8c6c0a587f7c80789198551383e8beb7b;hpb=6b3768e8c544739ae53321539cb4d1e3112ded1b diff --git a/ginac/simp_lor.cpp b/ginac/simp_lor.cpp index 32d05b0c..a102b74e 100644 --- a/ginac/simp_lor.cpp +++ b/ginac/simp_lor.cpp @@ -3,6 +3,24 @@ * Implementation of GiNaC's simp_lor objects. * No real implementation yet, to be done. */ +/* + * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany + * + * This program 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. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include #include #include @@ -10,7 +28,15 @@ #include #include -#include "ginac.h" +#include "simp_lor.h" +#include "ex.h" +#include "mul.h" +#include "symbol.h" +#include "debugmsg.h" + +#ifndef NO_GINAC_NAMESPACE +namespace GiNaC { +#endif // ndef NO_GINAC_NAMESPACE ////////// // default constructor, destructor, copy constructor assignment operator and helpers @@ -21,7 +47,7 @@ simp_lor::simp_lor() : type(invalid) { debugmsg("simp_lor default constructor",LOGLEVEL_CONSTRUCT); - tinfo_key=TINFO_SIMP_LOR; + tinfo_key=TINFO_simp_lor; } simp_lor::~simp_lor() @@ -71,39 +97,39 @@ void simp_lor::destroy(bool call_parent) simp_lor::simp_lor(simp_lor_types const t) : type(t) { debugmsg("simp_lor constructor from simp_lor_types",LOGLEVEL_CONSTRUCT); - tinfo_key=TINFO_SIMP_LOR; + tinfo_key=TINFO_simp_lor; } simp_lor::simp_lor(simp_lor_types const t, ex const & i1, ex const & i2) : indexed(i1,i2), type(t) { debugmsg("simp_lor constructor from simp_lor_types,ex,ex",LOGLEVEL_CONSTRUCT); - tinfo_key=TINFO_SIMP_LOR; - ASSERT(all_of_type_lorentzidx()); + tinfo_key=TINFO_simp_lor; + GINAC_ASSERT(all_of_type_lorentzidx()); } simp_lor::simp_lor(simp_lor_types const t, string const & n, ex const & i1) : indexed(i1), type(t), name(n) { debugmsg("simp_lor constructor from simp_lor_types,string,ex",LOGLEVEL_CONSTRUCT); - tinfo_key=TINFO_SIMP_LOR; - ASSERT(all_of_type_lorentzidx()); + tinfo_key=TINFO_simp_lor; + GINAC_ASSERT(all_of_type_lorentzidx()); } simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector const & iv) : indexed(iv), type(t), name(n) { debugmsg("simp_lor constructor from simp_lor_types,string,exvector",LOGLEVEL_CONSTRUCT); - tinfo_key=TINFO_SIMP_LOR; - ASSERT(all_of_type_lorentzidx()); + tinfo_key=TINFO_simp_lor; + GINAC_ASSERT(all_of_type_lorentzidx()); } simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector * ivp) : indexed(ivp), type(t), name(n) { debugmsg("simp_lor constructor from simp_lor_types,string,exvector*",LOGLEVEL_CONSTRUCT); - tinfo_key=TINFO_SIMP_LOR; - ASSERT(all_of_type_lorentzidx()); + tinfo_key=TINFO_simp_lor; + GINAC_ASSERT(all_of_type_lorentzidx()); } ////////// @@ -215,7 +241,7 @@ ex simp_lor::eval(int level) const int simp_lor::compare_same_type(basic const & other) const { - ASSERT(other.tinfo() == TINFO_SIMP_LOR); + GINAC_ASSERT(other.tinfo() == TINFO_simp_lor); const simp_lor *o = static_cast(&other); if (type==o->type) { if (name==o->name) { @@ -228,7 +254,7 @@ int simp_lor::compare_same_type(basic const & other) const bool simp_lor::is_equal_same_type(basic const & other) const { - ASSERT(other.tinfo() == TINFO_SIMP_LOR); + GINAC_ASSERT(other.tinfo() == TINFO_simp_lor); const simp_lor *o = static_cast(&other); if (type!=o->type) return false; if (name!=o->name) return false; @@ -305,7 +331,7 @@ simp_lor lor_vec(string const & n, ex const & mu) ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp) { - ASSERT(is_ex_exactly_of_type(m,mul)); + GINAC_ASSERT(is_ex_exactly_of_type(m,mul)); exvector v_contracted; // collect factors in an exvector, store squares twice @@ -313,7 +339,7 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp) v_contracted.reserve(2*n); for (int i=0; i