commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <>
Subject Re: [math] extend FieldElement<T>
Date Mon, 09 May 2011 17:52:19 GMT
Le 09/05/2011 09:15, Arne Plöse a écrit :
> Hi,
> here are some proposals for enhancing FieldElement<T>:
> add some shorthand "operators" for double i.e. add(double rhs) ... and
> so on.
> add:
> T negate();
> T sqrt();
> T pow(T x);
> T pow(double x);

This is possible only for negate() in the FieldElement<T>. Not all 
fields support sqrt or pow. A typical example is Fraction, the square 
root of a fraction may not be a fraction for example.

This is exactly this limitation that explains while only LU 
decomposition is implemented for fields and not other decomposition 

One possibility would be to add an ExtendedFieldElement<T> interface 
that would add these methods for the fields that support it (Complex, 
Dfp ...). Then, we could add new decomposition algorithms that would 
work on these extended fields (but still not on simpler fields like 

> the FieldVector interface should be enhanced with this methods as well.
> Yes, I know this has an impact on many classes ....

This is not really a problem, especially as we are defining a new major 
release, it is exactly the right time to propose such extensions.


> Arne
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message