Hi, 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 */. What then? Best regards, Alexei -- All science is either physics or stamp collecting.