From: Christian Bauer Date: Fri, 16 Mar 2001 18:08:48 +0000 (+0000) Subject: an indexed "0" is just a plain "0" X-Git-Tag: release_0-8-0~20 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=commitdiff_plain;h=e53c6d21b67ce4f5adafa7a33e703e202aa17ed0;p=ginac.git an indexed "0" is just a plain "0" --- diff --git a/ginac/indexed.cpp b/ginac/indexed.cpp index fb34df95..f5c53a6b 100644 --- a/ginac/indexed.cpp +++ b/ginac/indexed.cpp @@ -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