* Implementation of GiNaC's sums of expressions. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2009 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <iostream>
-#include <stdexcept>
-#include <limits>
-#include <string>
-
#include "add.h"
#include "mul.h"
#include "archive.h"
#include "clifford.h"
#include "ncmul.h"
+#include <iostream>
+#include <limits>
+#include <stdexcept>
+#include <string>
+
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(add, expairseq,
add::add()
{
- tinfo_key = &add::tinfo_static;
}
//////////
add::add(const ex & lh, const ex & rh)
{
- tinfo_key = &add::tinfo_static;
overall_coeff = _ex0;
construct_from_2_ex(lh,rh);
GINAC_ASSERT(is_canonical());
add::add(const exvector & v)
{
- tinfo_key = &add::tinfo_static;
overall_coeff = _ex0;
construct_from_exvector(v);
GINAC_ASSERT(is_canonical());
add::add(const epvector & v)
{
- tinfo_key = &add::tinfo_static;
overall_coeff = _ex0;
construct_from_epvector(v);
GINAC_ASSERT(is_canonical());
add::add(const epvector & v, const ex & oc)
{
- tinfo_key = &add::tinfo_static;
overall_coeff = oc;
construct_from_epvector(v);
GINAC_ASSERT(is_canonical());
add::add(std::auto_ptr<epvector> vp, const ex & oc)
{
- tinfo_key = &add::tinfo_static;
GINAC_ASSERT(vp.get()!=0);
overall_coeff = oc;
construct_from_epvector(*vp);
// archiving
//////////
-DEFAULT_ARCHIVING(add)
+GINAC_BIND_UNARCHIVER(add);
//////////
// functions overriding virtual functions from base classes
return seq.begin()->rest.return_type();
}
-tinfo_t add::return_type_tinfo() const
+return_type_t add::return_type_tinfo() const
{
if (seq.empty())
- return this;
+ return make_return_type_t<add>();
else
return seq.begin()->rest.return_type_tinfo();
}