*
* Implementation of GiNaC's sums of expressions. */
+/*
+ * 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 <iostream>
#include <stdexcept>
-#include "ginac.h"
+#include "add.h"
+#include "mul.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
add::add()
{
debugmsg("add default constructor",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_ADD;
+ tinfo_key = TINFO_add;
}
add::~add()
add::add(ex const & lh, ex const & rh)
{
debugmsg("add constructor from ex,ex",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_ADD;
+ tinfo_key = TINFO_add;
overall_coeff=exZERO();
construct_from_2_ex(lh,rh);
ASSERT(is_canonical());
add::add(exvector const & v)
{
debugmsg("add constructor from exvector",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_ADD;
+ tinfo_key = TINFO_add;
overall_coeff=exZERO();
construct_from_exvector(v);
ASSERT(is_canonical());
add::add(epvector const & v, bool do_not_canonicalize)
{
debugmsg("add constructor from epvector,bool",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_ADD;
+ tinfo_key = TINFO_add;
if (do_not_canonicalize) {
seq=v;
#ifdef EXPAIRSEQ_USE_HASHTAB
add::add(epvector const & v)
{
debugmsg("add constructor from epvector",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_ADD;
+ tinfo_key = TINFO_add;
overall_coeff=exZERO();
construct_from_epvector(v);
ASSERT(is_canonical());
add::add(epvector const & v, ex const & oc)
{
debugmsg("add constructor from epvector,ex",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_ADD;
+ tinfo_key = TINFO_add;
overall_coeff=oc;
construct_from_epvector(v);
ASSERT(is_canonical());
add::add(epvector * vp, ex const & oc)
{
debugmsg("add constructor from epvector *,ex",LOGLEVEL_CONSTRUCT);
- tinfo_key = TINFO_ADD;
+ tinfo_key = TINFO_add;
ASSERT(vp!=0);
overall_coeff=oc;
construct_from_epvector(*vp);
exvector add::get_indices(void) const
{
- // all terms in the sum should have the same indices (compatible tensors)
- // however this is not checked, since there is no function yet which
- // compares indices (idxvector can be unsorted) !!!!!!!!!!!
+ // FIXME: all terms in the sum should have the same indices (compatible
+ // tensors) however this is not checked, since there is no function yet
+ // which compares indices (idxvector can be unsorted)
if (seq.size()==0) {
return exvector();
}
const add some_add;
type_info const & typeid_add=typeid(some_add);
-
-
+} // namespace GiNaC