A new utility class, PolynomialsUtils has been added with factory
methods for Chebyshev, Hermite, Laguerre and Legendre polynomials.
The code has been adapted from mantissa, mainly for the sake of
simplicity. Part of the simplification was to replace the class
RationalNumber from mantissa with [math] Fraction class. The former uses
BigInteger whereas the later uses integers to store numerator and
denominator. This leads to problems for some orthogonal polynomials. For
example trying to compute the degree 40 Legendre polynomial triggers an
Arithmetic exception (see the junit tests for an example). This kind of
polynomials are used in spherical functions modeling (spherical
harmonics) at very high degrees, sometimes up to a few hundreds.
Do you think we should add a BigFraction class for such cases ?
Computation time is not an issue here because of caching.
Luc
Luc Maisonobe a écrit :
> Gilles Sadowski a écrit :
>> Hello.
>>
>> Would you consider transferring the contents of the Mantissa "algebra"
>> package to CommonsMath?
>
> The orthogonal polynomials would be a nice addition. The current
> implementation in Mantissa does not look good to me, after a few years.
> The two internal classes Polynomial.Double and
> Polynomial.RationalNumber, which are mimicked after the
> java.awt.geom.Point2D class and its two Point2D.Double and Point2D.Float
> classes seems clumsy now.
>
> If we consider preserving two classes, one for double and another one
> for computation, I wonder if we should not split them in parallel but
> unrelated classes, just like RealMatrix and BigMatrix. We could add the
> class with exact computation afterwards too, only if really needed.
>
> I also wonder if dedicated classes are needed. Mantissa provides one
> abstract base class OrhtogonalPolynomial and one class for each type
> (Chebyshev, Legendre, Laguerre, Hermite). Could we simply use the
> existing polynomials class and add a utility class PolynomialsUtils with
> factory methods createXxxPolynomial() ? This utility class would cache
> already computed coefficients as exact Fraction instances and create the
> polynomials by converting the Fraction to simple double arrays at
> construction time.
>
> Any thoughts ?
>
> Luc
>
>> Thanks,
>> Gilles
>>
>> 
>> To unsubscribe, email: devunsubscribe@commons.apache.org
>> For additional commands, email: devhelp@commons.apache.org
>>
>>
>
>
> 
> To unsubscribe, email: devunsubscribe@commons.apache.org
> For additional commands, email: devhelp@commons.apache.org
>

To unsubscribe, email: devunsubscribe@commons.apache.org
For additional commands, email: devhelp@commons.apache.org
