commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <Luc.Maison...@free.fr>
Subject Re: [math] Package transform revisited
Date Thu, 09 Feb 2012 09:44:18 GMT
Le 09/02/2012 08:46, Sébastien Brisard a écrit :
> Hi,
> while working on MATH-732, I've made some amendments to the
> FastFourierTransformer API. Basically, I've removed the factory
> methods create() and createUnitary() I had previously introduced in
> MATH-677. Instead, I introduced an enum {STANDARD, UNITARY}. This
> allows the specification of the type of normalization to be applied in
> the *static* method transformInPlace. Indeed, I do not like boolean
> parameters, plus, they are limited to only two types of
> normalizations. If we ever wanted to introduce a third (unlikely)
> normalization, that would no longer work. Enums are much easier to
> read.
> If you like these changes, I propose to do the same for all classes in
> package transform. This would mean that I reopen MATH-677 for a brief
> period of time. This is probably sub-optimal in a prerelease period,
> so it's really your call.
> One last change I'm considering would be to introduce an enum
> TransformType{FORWARD, INVERSE}, and replace the methods
> - transform(double[])
> - inverseTransform(double[])
> with transform(double[], TransformType).
> What do you think?

I agree with you, enums are much better. There are other places in
[math] where we use boolean or even ints for such things. They mainly
came for pre-java 5 era when enums where not available.

Luc

> 
> Sébastien
> 
> PS: thinking about it, maybe I should create a new JIRA ticket
> altogether, instead of reopening MATH-677.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message