On 02/19/2016 11:53 PM, Ralf Hemmecke wrote:
> Laurent series.
> 
> Multiplication is implemented like this.
> 
> x : % * y : % == laurent(getExpon x + getExpon y, getUTS x * getUTS y)

Since I have anyway a wrapper for Laurent series in my program, I
changed the zero?(x) function there to destructively change x to
(removeZeroes(x)). That works for my special case since I work with
special Laurent series that allow algorithmic zero detection.

Anyway, this little change led to a computation trace without any memory
problem.

But now the question is how and whether the current implementation of
UnivariateLaurentSeries should be changed without too much impact on
existing code that uses that domain.

A good place to (destructively) change x when computing some function
would be order: % -> Integer and order: (%, Integer) -> Integer.
According to the documentation the order function looks for the first
non-zero coefficient, so it needs to compute till the true order (or run
into an infinite loop). I have no idea whether this place would be
sufficient (probably not), but at least the series would behave a bit
better.

One could additionally think of checking whether after addition (or
multiplication in a ring with zero divisors) the leading coefficient is
zero and thus increasing the order by at least 1.
In fact, I think it would be a good idea to try checking the coeffients
as long as the order is negative and stop at order=1 if all coefficients
are 0. Furthermore, for a series x that yields n:=getExpon(x)>0 one
would test (at most) n coefficients to get closer to the true order of
the series.

Now, though I find all this quite reasonable, it is also questionable,
because it involves the computation of more and more coefficients and
thus the series do not behave as lazy as they could. That could cause
problems.

However, according to how multiplication is currently implemented, it
makes perfectly sense to first get (at least closer to) the true order
since otherwise computing already the first coefficient of the result
involves computing too many coefficients of the multiplicants.

Opinions?

Ralf



-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to