
com.brettonw.math.Utility Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clustering Show documentation
Show all versions of clustering Show documentation
Clustering is a Java library for identifying similar data in n-dimensional spaces.
package com.brettonw.math;
import java.util.List;
public class Utility {
public static boolean close (double a, double b) {
return (Math.abs (a - b) < 1.0e-6);
}
public static int[] IntegerListToIntArray (List list) {
// convert the result list to an array, no library already does this...
int resultSize = list.size ();
int[] result = new int[resultSize];
for (int i = 0; i < resultSize; ++i) {
result[i] = list.get (i);
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy