Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-552

MultidimensionalCounter.getCounts(int) returns wrong array of indices

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 3.0
    • Labels:
      None
    • Environment:

      Java 1.6

      Description

      MultidimensionalCounter counter = new MultidimensionalCounter(2, 4);
      for (Integer i : counter) {
      int[] x = counter.getCounts;
      System.out.println(i + " " + Arrays.toString);
      }

      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]

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jbence@pobox.com James Bence
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: