]> www.ginac.de Git - ginac.git/blobdiff - ginac/add.cpp
skeleton implementation of new color class
[ginac.git] / ginac / add.cpp
index 0c22465a10021e54828d149bdda3502ee1e3e25b..150b4f8222d0df346dd357b104656f9fd70aaf15 100644 (file)
@@ -37,26 +37,14 @@ GINAC_IMPLEMENT_REGISTERED_CLASS(add, expairseq)
 // 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
@@ -115,23 +103,7 @@ add::add(epvector * vp, const ex & oc)
 // 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
@@ -354,17 +326,6 @@ ex add::eval(int level) const
        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) {