Skip to content

Commit

Permalink
Fix bugs in Histogram
Browse files Browse the repository at this point in the history
Histogram returned wrong indices for non equidistant bins.
Partial fix for #80
  • Loading branch information
wirew0rm committed Jan 16, 2020
1 parent a21433d commit 7de7d50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ public double getBinContent(final int bin) {
return data[bin];
}

@Override
public int getDataCount() {
return getDataCount(DIM_X);
}

@Override
public int getDataCount(final int dimIndex) {
return nAxisBins[dimIndex] - 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@ public double get(final int dimIndex, final int index) {

@Override
public List<String> getErrorList() {
return Collections.<String>emptyList();
return Collections.<String> emptyList();
}

@Override
public int getIndex(int dimIndex, double value) {
return findBin(dimIndex, value);
return findBin(dimIndex, value) - 1;
}

@Override
public List<String> getInfoList() {
return Collections.<String>emptyList();
return Collections.<String> emptyList();
}

@Override
Expand Down

0 comments on commit 7de7d50

Please sign in to comment.