You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2018/03/21 12:31:00 UTC

[jira] [Commented] (NUMBERS-72) Initialization of Complex arrays

    [ https://issues.apache.org/jira/browse/NUMBERS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16407823#comment-16407823 ] 

Gilles commented on NUMBERS-72:
-------------------------------

bq. Complex constructor is private, arrays of Complex objects break

What used to work and doesn't anymore?

bq.  "complexArray(5, 4, 3)" returning the result of the previous "new Complex[5][4][3]"

I don't follow: {{new Complex[5][4][3]}} works fine (cf. unit tests).


> Initialization of Complex arrays
> --------------------------------
>
>                 Key: NUMBERS-72
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-72
>             Project: Commons Numbers
>          Issue Type: Improvement
>            Reporter: Eric Barnhill
>            Priority: Minor
>
> Now that the Complex constructor is private, arrays of Complex objects break. So, it is no longer backwards-compatible with most of my Complex code.
> If we are not concerned about backwards compatibility with commons-math, I propose we add a method in Complex or ComplexUtils taking array dimensions, e.g. "complexArray(5, 4, 3)" returning the result of the previous "new Complex[5][4][3]" (though slightly better as the Complex objects can all be initialized to 0,0).
>  
> EDIT: it will have to be in the Complex class if the constructor is private. So I will add this.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)