commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Barnhill (JIRA)" <>
Subject [jira] [Commented] (NUMBERS-10) Revamp "Complex" representation ?
Date Wed, 08 Mar 2017 13:27:37 GMT


Eric Barnhill commented on NUMBERS-10:


Thanks for suggesting this interesting idea for Complex, however having worked it through
I think we should pass on it for these reasons:

- The previous math crew worked out the math of all the Complex functions rigorously, I would
rather stick with what has already been carefully validated than put in the time to reinvent
the math in polar coordinates
- Related libraries in other languages have found satisfactory performance using real and
imaginary storage only
- I think getting the "syntactical sugar" in place so that public users can call familiar
c++ methods, and conforming all special cases to the c++ 11 standard, and bringing in a shaded
JTransforms FFT are the more important issues

For these reasons I think we should close the ticket. I will try to keep to a one month timetable
for the rest of the goals, so that Complex can finally be done.


> Revamp "Complex" representation ?
> ---------------------------------
>                 Key: NUMBERS-10
>                 URL:
>             Project: Commons Numbers
>          Issue Type: Wish
>            Reporter: Gilles
>              Labels: API, design, review
>             Fix For: 1.0
>         Attachments:,,,
> This is a proposal to enhance the internal representation of complex numbers.
> The purpose is to allow usage of both cartesian and polar representations, with the aim
that calculations are performed (transparently) with the one that will be more accurate and/or
> The API would certainly be improved, from
> {code}
>         final Complex c1 = Complex.valueOf(1, 2);
>         final Complex c2 = ComplexUtils.polar2Complex(2, 7);
>         final Complex r = c1.add(c2);
>  {code}
> with the current code, to
> {code}
>         final Complex c1 = Complex.createCartesian(1, 2);
>         final Complex c2 = Complex.createPolar(2, 7);
>         final Complex r = c1.add(c2);
> {code}
> Please refer to the attached files (they are self-documenting, but of course, Javadoc
must be added if the proposal is validated).
> Would there be merit in pursuing in that direction?
> Or is there any show-stopper?

This message was sent by Atlassian JIRA

View raw message