*/
public static FlexiHistogram<IntIntPair, IntIntPair> IntSumIntSumHistogram(int bins) {
return new FlexiHistogram<IntIntPair, IntIntPair>(bins, new Adapter<IntIntPair, IntIntPair>() {
@Override
public IntIntPair make() {
return new IntIntPair(0, 0);
}
@Override
public IntIntPair cloneForCache(IntIntPair data) {
return new IntIntPair(data.first, data.second);
}
@Override
public IntIntPair downsample(IntIntPair first, IntIntPair second) {
return new IntIntPair(first.first + second.first, first.second + second.second);
}
@Override
public IntIntPair aggregate(IntIntPair existing, IntIntPair data) {
existing.first = existing.first + data.first;