commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (MATH-552) MultidimensionalCounter.getCounts(int) returns wrong array of indices
Date Fri, 01 Apr 2011 10:14:05 GMT

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

Gilles resolved MATH-552.
-------------------------

       Resolution: Fixed
    Fix Version/s: 3.0

Oops, I wrote this code :(. Many thanks for finding out and fixing that bug.
Patch applied in revision 1087637.


> MultidimensionalCounter.getCounts(int) returns wrong array of indices
> ---------------------------------------------------------------------
>
>                 Key: MATH-552
>                 URL: https://issues.apache.org/jira/browse/MATH-552
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.2
>         Environment: Java 1.6
>            Reporter: James Bence
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: MultidimensionalCounter.patch
>
>
> MultidimensionalCounter counter = new MultidimensionalCounter(2, 4);
> for (Integer i : counter) {
>     int[] x = counter.getCounts(i);
>     System.out.println(i + " " + Arrays.toString(x));
> }
> Output is:
> 0 [0, 0]
> 1 [0, 1]
> 2 [0, 2]
> 3 [0, 2]   <=== should be [0, 3]
> 4 [1, 0]
> 5 [1, 1]
> 6 [1, 2]
> 7 [1, 2]   <=== should be [1, 3]

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message