Refactor of the downsampling machinery to accept different strategies
* Implemented Adaptive downsampler * Added integration test * Added option to RRead scala script to choose downsampling strategy
This commit is contained in:
parent
cce8511d29
commit
4a208c7c06
|
|
@ -573,6 +573,10 @@ public class MathUtils {
|
|||
return array[minElementIndex(array)];
|
||||
}
|
||||
|
||||
public static int arrayMin(int[] array) {
|
||||
return array[minElementIndex(array)];
|
||||
}
|
||||
|
||||
public static byte arrayMin(byte[] array) {
|
||||
return array[minElementIndex(array)];
|
||||
}
|
||||
|
|
@ -601,6 +605,18 @@ public class MathUtils {
|
|||
return minI;
|
||||
}
|
||||
|
||||
public static int minElementIndex(int[] array) {
|
||||
if (array == null) throw new IllegalArgumentException("Array cannot be null!");
|
||||
|
||||
int minI = -1;
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
if (minI == -1 || array[i] < array[minI])
|
||||
minI = i;
|
||||
}
|
||||
|
||||
return minI;
|
||||
}
|
||||
|
||||
public static int arrayMaxInt(List<Integer> array) {
|
||||
if (array == null) throw new IllegalArgumentException("Array cannot be null!");
|
||||
if (array.size() == 0) throw new IllegalArgumentException("Array size cannot be 0!");
|
||||
|
|
|
|||
Loading…
Reference in New Issue