// default constructor, destructor, copy constructor assignment operator and helpers
//////////
-// public
-
add::add()
{
debugmsg("add default constructor",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
}
-// protected
-
-/** For use by copy ctor and assignment operator. */
-void add::copy(const add & other)
-{
- inherited::copy(other);
-}
-
-void add::destroy(bool call_parent)
-{
- if (call_parent) inherited::destroy(call_parent);
-}
+DEFAULT_COPY(add)
+DEFAULT_DESTROY(add)
//////////
// other constructors
// archiving
//////////
-/** Construct object from archive_node. */
-add::add(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
-{
- debugmsg("add constructor from archive_node", LOGLEVEL_CONSTRUCT);
-}
-
-/** Unarchive the object. */
-ex add::unarchive(const archive_node &n, const lst &sym_lst)
-{
- return (new add(n, sym_lst))->setflag(status_flags::dynallocated);
-}
-
-/** Archive the object. */
-void add::archive(archive_node &n) const
-{
- inherited::archive(n);
-}
+DEFAULT_ARCHIVING(add)
//////////
// functions overriding virtual functions from bases classes
return this->hold();
}
-exvector add::get_indices(void) const
-{
- // 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();
- }
- return (seq.begin())->rest.get_indices();
-}
-
ex add::simplify_ncmul(const exvector & v) const
{
if (seq.size()==0) {