Commons Math
  1. Commons Math
  2. MATH-552

MultidimensionalCounter.getCounts(int) returns wrong array of indices

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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(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]

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            James Bence
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development