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 sections
    static void removeNotInRange​(List<Double> values, double lowerBound, double upperBound)
    Removes values in a list which are not in the given range
    static void removeRepeatsSort​(List<Double> values)
    Removes a number from a List if that number is adjacent to the same number within a tolerance of Settings.equalsMargin
    static double strictToRange​(double value, double lowerBound, double upperBound)
    Returns [value] if it is in the range, and NaN otherwise

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 range
      lower - the lower bound of the range
      sections - 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 of Settings.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 removed
      lowerBound - the lower bound of the range
      upperBound - 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 checked
      lowerBound - the lower bound of the range
      upperBound - the upper bound of the range
      Returns:
      [value] if it is the range, and NaN otherwise