commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <>
Subject [jira] Commented: (MATH-171) Merge (most of) ComplexUtils into Complex
Date Tue, 06 Nov 2007 19:59:50 GMT


Niall Pemberton commented on MATH-171:

Another advantage is that it allows people to create alternative Complex instances, overriding
the deafult implementation of functions (for example MATH-164) - having said that since these
functions (and existing add(), subtract(), multiply(), divide() functions) create new Complex
instances - then custom implementations would return the default implementation rather than
the custom one - causing inconsistent behaviour. This is already a potential issue as it stands-
I guess the solution would be to use a factory or add a factory method to Complex.

> Merge (most of) ComplexUtils into Complex
> -----------------------------------------
>                 Key: MATH-171
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 1.1
>            Reporter: Niall Pemberton
>            Priority: Minor
>         Attachments: commons-math-complex-func.patch
> All but two of the functions in ComplexUtils operate on a single Complex instance. I
think it would make coding easier (esp. with an IDE) if the ComplexUtils functions were merged
into Complex. For example, using the cos function changes from:
>     Complex cosA = ComplexUtils.cos(a);
> to
>     Complex cosA = a.cos();

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message