[ 
https://issues.apache.org/jira/browse/MATH-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540538
 ] 

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: https://issues.apache.org/jira/browse/MATH-171
>             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.

Reply via email to