[GiNaC-list] Bug with evalm()?
varg at theor.jinr.ru
Mon Feb 12 10:59:06 CET 2007
On Mon, Feb 12, 2007 at 10:01:14AM +0100, Chris Dams wrote:
> What about the following code?
> matrix m(2,2);
> m = exp(x), 0,
> 0, sin(x);
> ex f = m*m;
> f = f.series(x,2);
> f = evalm(f);
For series of matrix-valued functions my patch is obviously incorrect.
> I'd say that it would be best to make .map() also work with power series
> and to make it apply the map function to the coefficients of the power
> series. In that case I would also like to have pseries::eval check for
> zero coefficients and not store these. Any objections againts this idea?
First of all, this violates principle of least surprise. For all other
classes map() operates on each term, why pseries should be different?
Secondly, when operating on coefficients one often needs to know
corresponding degrees too. How do we provide access to degrees?
Finally, a map function could transform terms in such a way that result
is not a power series any more, e.g.
a*x^n => a*exp(exp(...(exp(x)))) /* n times */.
All science is either physics or stamp collecting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 827 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/ginac-list/attachments/20070212/d5db1f5f/attachment.pgp
More information about the GiNaC-list