an indexed "0" is just a plain "0"
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Fri, 16 Mar 2001 18:08:48 +0000 (18:08 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Fri, 16 Mar 2001 18:08:48 +0000 (18:08 +0000)
ginac/indexed.cpp

index fb34df9502a861c35f32cd739f01c4410e605ed6..f5c53a6bb956e6606b125c80a248c840840cb809 100644 (file)
@@ -330,6 +330,10 @@ ex indexed::eval(int level) const
        if (level > 1)
                return indexed(symmetry, evalchildren(level));
 
+       // If the base object is 0, the whole object is 0
+       if (seq[0].is_zero())
+               return _ex0();
+
        // Canonicalize indices according to the symmetry properties
        if (seq.size() > 2 && (symmetry != unknown && symmetry != mixed)) {
                exvector v = seq;
@@ -343,7 +347,7 @@ ex indexed::eval(int level) const
        }
 
        // Let the class of the base object perform additional evaluations
-       return op(0).bp->eval_indexed(*this);
+       return seq[0].bp->eval_indexed(*this);
 }
 
 ex indexed::thisexprseq(const exvector & v) const