improvement (hopefully) to subs and a patch included
Christian Bauer
cbauer at thep.physik.uni-mainz.de
Wed Nov 27 18:36:19 CET 2002
Hi!
On Mon, Nov 18, 2002 at 12:11:28PM +0000, Chris Dams wrote:
> Here is a patch that is supposed to make substitutions, optionally, a bit
> more semantic (as opposed to syntactic).
This looks interesting. Any particular reason why sums aren't treated in
a "smart" (should we call that "algebraic") way?
> The subs method gets an extra optional argument like this
>
> ex subs(const lst & ls, const lst & lr, unsigned options = 0, bool no_pattern = false) const
The 'no_pattern' could be moved to 'options' (something like
'subs_options::no_pattern').
> cout << (4*x*x*x-2*x*x+5*x-1).subs(pow(x,wild())==pow(a,wild()),
> subs_options::subs_smart) << endl;
> // --> -1+5*x+4*x^3-2*x^2
Not "-1+5*a+4*a^3-2*a^2"? (I haven't tried the patch yet...)
> I do not know whether
> diff -c -r --exclude=CVS
> is the most convenient format for a patch for you.
"cvs diff" is fine (no, you don't need to resend the patch :).
Bye,
Christian
--
/ Coding on PowerPC and proud of it
\/ http://www.uni-mainz.de/~bauec002/
More information about the GiNaC-devel
mailing list