Package tools
Class SolverTools
Object
SolverTools
public class SolverTools
extends Object
The
SolverTools class contains miscellaneous methods used in Solver.-
Method Summary
Modifier and Type Method Description static List<Double>createRange(double upper, double lower, int sections)Returns a list of Doubles that represents a range split into a certain amount of sections by storing the endpoints of the sectionsstatic voidremoveNotInRange(List<Double> values, double lowerBound, double upperBound)Removes values in a list which are not in the given rangestatic voidremoveRepeatsSort(List<Double> values)Removes a number from a List if that number is adjacent to the same number within a tolerance ofSettings.equalsMarginstatic doublestrictToRange(double value, double lowerBound, double upperBound)Returns [value] if it is in the range, and NaN otherwise
-
Method Details
-
createRange
public static List<Double> createRange(double upper, double lower, int sections)Returns a list of Doubles that represents a range split into a certain amount of sections by storing the endpoints of the sections- Parameters:
upper- the upper bound of the rangelower- the lower bound of the rangesections- the amount of sections that the range is split into- Returns:
- the specified List
-
removeRepeatsSort
public static void removeRepeatsSort(List<Double> values)Removes a number from a List if that number is adjacent to the same number within a tolerance ofSettings.equalsMargin- Parameters:
values- the List from which the repeated values are removed
-
removeNotInRange
public static void removeNotInRange(List<Double> values, double lowerBound, double upperBound)Removes values in a list which are not in the given range- Parameters:
values- the list from which values are being removedlowerBound- the lower bound of the rangeupperBound- the upper bound of the range
-
strictToRange
public static double strictToRange(double value, double lowerBound, double upperBound)Returns [value] if it is in the range, and NaN otherwise- Parameters:
value- the value to be checkedlowerBound- the lower bound of the rangeupperBound- the upper bound of the range- Returns:
- [value] if it is the range, and NaN otherwise
-