From 2053dbc953da03b57dfd7da01fcdc196e8b8e912 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Wed, 28 Jan 2004 19:34:55 +0000 Subject: [PATCH] expand_indexed expands the base expression --- ginac/indexed.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/ginac/indexed.cpp b/ginac/indexed.cpp index 0bb34d8a..40a6232c 100644 --- a/ginac/indexed.cpp +++ b/ginac/indexed.cpp @@ -325,20 +325,24 @@ ex indexed::expand(unsigned options) const { GINAC_ASSERT(seq.size() > 0); - if ((options & expand_options::expand_indexed) && is_exactly_a(seq[0])) { - - // expand_indexed expands (a+b).i -> a.i + b.i - const ex & base = seq[0]; - ex sum = _ex0; - for (size_t i=0; i(newbase)) { + ex sum = _ex0; + for (size_t i=0; i(thiscontainer(s)).inherited::expand(options); } - return sum; - - } else - return inherited::expand(options); + } + return inherited::expand(options); } ////////// -- 2.44.0