series expansion of powers.
Chris Dams
chrisd at sci.kun.nl
Wed Apr 21 13:58:37 CEST 2004
Hello,
Recently I had to find the power series to 11th order of the fifth power
of a polynomial of degree 11 containing all kinds of symbols. The thing
that was raised to the fifth power had 139 terms. The point of course is
that in this case you do not want to have the full expansion of this power
because it is way too large, takes too much time, and not necesary to find
the answer. However, using the series method falls back on basic::series
and this uses expand() internally. The conclusion would be that
power::series is a bit to eager to use basic::series. Changing the line
if (!must_expand_basis && !exponent.info(info_flags::negint))
that occurs in power::series into
if (!must_expand_basis && !exponent.info(info_flags::negint) && !is_a<add>(basis))
makes this calculation finish within the second.
Bye,
Chris Dams
More information about the GiNaC-devel
mailing list