X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fmul.cpp;h=4e95a638310e313444c45736af5b1d090a8f6076;hp=298715b33fd2eabfd28ea9390229fb3f5b90b39d;hb=a58e540b7d534d64c1c87cc253b3cf40bf58df06;hpb=da6a61ba2586263e46ade4b67dca121506c2bff9 diff --git a/ginac/mul.cpp b/ginac/mul.cpp index 298715b3..4e95a638 100644 --- a/ginac/mul.cpp +++ b/ginac/mul.cpp @@ -1002,7 +1002,13 @@ ex mul::expand(unsigned options) const return (new mul(*this))->setflag(status_flags::dynallocated | status_flags::expanded); } - const bool skip_idx_rename = ! info(info_flags::has_indices); + // do not rename indices if the object has no indices at all + if ((!(options & expand_options::expand_rename_idx)) && + this->info(info_flags::has_indices)) + options |= expand_options::expand_rename_idx; + + const bool skip_idx_rename = !(options & expand_options::expand_rename_idx); + // First, expand the children std::auto_ptr expanded_seqp = expandchildren(options); const epvector & expanded_seq = (expanded_seqp.get() ? *expanded_seqp : seq);