commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <j...@apache.org>
Subject [jira] Updated: (MATH-171) Merge (most of) ComplexUtils into Complex
Date Tue, 06 Nov 2007 20:12:51 GMT

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

Niall Pemberton updated MATH-171:
---------------------------------

    Attachment: commons-math-complex-func-v2.patch

Attaching version 2 of patch which includes a factory method for Complex.

So to create a custom implementation....

public class MyComplex etends Complex {

    public MyComplex(double real, double imaginary) {
        super(real, imaginary);
    }

    // override/implement custom behaviour

    protected Complex createComplex(double real, double imaginary) {
        return new MyComplex(real, imaginary);
    }

}


> 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-v2.patch, 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.


Mime
View raw message