* Implementation of GiNaC's symbolic integral. */
/*
- * GiNaC Copyright (C) 1999-2006 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2008 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
//////////
integral::integral()
- : inherited(&integral::tinfo_static),
+ :
x((new symbol())->setflag(status_flags::dynallocated))
{}
// public
integral::integral(const ex & x_, const ex & a_, const ex & b_, const ex & f_)
- : inherited(&integral::tinfo_static), x(x_), a(a_), b(b_), f(f_)
+ : x(x_), a(a_), b(b_), f(f_)
{
if (!is_a<symbol>(x)) {
throw(std::invalid_argument("first argument of integral must be of type symbol"));
// archiving
//////////
-integral::integral(const archive_node & n, lst & sym_lst) : inherited(n, sym_lst)
+void integral::read_archive(const archive_node& n, lst& sym_lst)
{
+ inherited::read_archive(n, sym_lst);
n.find_ex("x", x, sym_lst);
n.find_ex("a", a, sym_lst);
n.find_ex("b", b, sym_lst);
n.add_ex("f", f);
}
-DEFAULT_UNARCHIVE(integral)
-
//////////
// functions overriding virtual functions from base classes
//////////
struct error_and_integral_is_less
{
- bool operator()(const error_and_integral &e1,const error_and_integral &e2)
+ bool operator()(const error_and_integral &e1,const error_and_integral &e2) const
{
int c = e1.integral.compare(e2.integral);
if(c < 0)
return f.return_type();
}
-tinfo_t integral::return_type_tinfo() const
+return_type_t integral::return_type_tinfo() const
{
return f.return_type_tinfo();
}
return *this;
}
+GINAC_BIND_UNARCHIVER(integral);
} // namespace GiNaC