From: Christian Bauer Date: Sat, 6 Jan 2001 19:18:29 +0000 (+0000) Subject: when normal() doesn't recur any further because the specified recursion level X-Git-Tag: release_0-7-1~20 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=6d89c8f370b4f5f98319f340aa0da31cbdff0dc5 when normal() doesn't recur any further because the specified recursion level was reached, the remaining subexpression is replaced by a symbol to avoid continuing with non-polynomial expressions --- diff --git a/ginac/normal.cpp b/ginac/normal.cpp index 1cbb8773..d59e42d5 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -1910,7 +1910,7 @@ static ex frac_cancel(const ex &n, const ex &d) ex add::normal(lst &sym_lst, lst &repl_lst, int level) const { if (level == 1) - return (new lst(*this, _ex1()))->setflag(status_flags::dynallocated); + return (new lst(replace_with_symbol(*this, sym_lst, repl_lst), _ex1()))->setflag(status_flags::dynallocated); else if (level == -max_recursion_level) throw(std::runtime_error("max recursion level reached")); @@ -1991,7 +1991,7 @@ ex add::normal(lst &sym_lst, lst &repl_lst, int level) const ex mul::normal(lst &sym_lst, lst &repl_lst, int level) const { if (level == 1) - return (new lst(*this, _ex1()))->setflag(status_flags::dynallocated); + return (new lst(replace_with_symbol(*this, sym_lst, repl_lst), _ex1()))->setflag(status_flags::dynallocated); else if (level == -max_recursion_level) throw(std::runtime_error("max recursion level reached")); @@ -2022,7 +2022,7 @@ ex mul::normal(lst &sym_lst, lst &repl_lst, int level) const ex power::normal(lst &sym_lst, lst &repl_lst, int level) const { if (level == 1) - return (new lst(*this, _ex1()))->setflag(status_flags::dynallocated); + return (new lst(replace_with_symbol(*this, sym_lst, repl_lst), _ex1()))->setflag(status_flags::dynallocated); else if (level == -max_recursion_level) throw(std::runtime_error("max recursion level reached"));