14 Apr
2001
14 Apr
'01
1:15 p.m.
Sorry to bother you again but my previous fix didn't work. Below is given a working version. Any ideas how to optimize it? Btw, I have noticed that you use frequently for (int n=this->ldegree(s); n<=this->degree(s); n++) instead of more efficient for (int n=this->ldegree(s), m=this->degree(s); n<=m; ++n) that saves repeated calling of the degree() method. On Fri, 13 Apr 2001, Pearu Peterson wrote:
As a fix, the collect function should be
ex basic::collect(const ex & s) const { ex x; for (int n=this->ldegree(s); n<=this->degree(s); n++) x += this->coeff(s,n)*power(s,n); x += (*this - x).expand(); return x; } Regards, Pearu