From: Chris Dams Date: Fri, 7 Jul 2006 13:35:29 +0000 (+0000) Subject: Allow, optionally, indices to be substituted by things that are not indices. X-Git-Tag: release_1-4-0~82 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=7e68cf1c0515b0397a49a13f2f08decae7509af1 Allow, optionally, indices to be substituted by things that are not indices. --- diff --git a/ginac/flags.h b/ginac/flags.h index 6cf3ea94..8ef1c0ac 100644 --- a/ginac/flags.h +++ b/ginac/flags.h @@ -52,7 +52,11 @@ public: subs_algebraic = 0x0002, // for backwards compatibility pattern_is_product = 0x0004, ///< used internally by expairseq::subschildren() pattern_is_not_product = 0x0008, ///< used internally by expairseq::subschildren() - no_index_renaming = 0x0010 + no_index_renaming = 0x0010, + // To indicate that we want to substitue an index by something that is + // is not an index. Without this flag the index value would be + // substituted in that case. + really_subs_idx = 0x0020 }; }; diff --git a/ginac/idx.cpp b/ginac/idx.cpp index e531f0f3..73af6aac 100644 --- a/ginac/idx.cpp +++ b/ginac/idx.cpp @@ -365,7 +365,7 @@ ex idx::subs(const exmap & m, unsigned options) const if (it != m.end()) { // Substitution index->index - if (is_a(it->second)) + if (is_a(it->second) || (options & subs_options::really_subs_idx)) return it->second; // Otherwise substitute value