Tabnine Logo
PiecewiseUtilities.getTolerance
Code IndexAdd Tabnine to your IDE (free)

How to use
getTolerance
method
in
it.geosolutions.jaiext.piecewise.PiecewiseUtilities

Best Java code snippets using it.geosolutions.jaiext.piecewise.PiecewiseUtilities.getTolerance (Showing top 2 results out of 315)

origin: it.geosolutions.jaiext.piecewise/jt-piecewise

/**
 * Returns {@code true} if the given doubles are equals. Positive and negative zero are considered different, while a NaN value is considered
 * equal to other NaN values.
 * 
 * @param o1 The first value to compare.
 * @param o2 The second value to compare.
 * @return {@code true} if both values are equal.
 * 
 * @see Double#equals
 */
public static boolean equals(double o1, double o2) {
  if (Double.doubleToLongBits(o1) == Double.doubleToLongBits(o2))
    return true;
  double tol = getTolerance();
  final double min = o1 - Math.signum(o1) * o1 * tol;
  final double max = o1 + Math.signum(o1) * o1 * tol;
  return min <= o2 && o2 <= max;
}
origin: geosolutions-it/jai-ext

/**
 * Returns {@code true} if the given doubles are equals. Positive and negative zero are considered different, while a NaN value is considered
 * equal to other NaN values.
 * 
 * @param o1 The first value to compare.
 * @param o2 The second value to compare.
 * @return {@code true} if both values are equal.
 * 
 * @see Double#equals
 */
public static boolean equals(double o1, double o2) {
  if (Double.doubleToLongBits(o1) == Double.doubleToLongBits(o2))
    return true;
  double tol = getTolerance();
  final double min = o1 - Math.signum(o1) * o1 * tol;
  final double max = o1 + Math.signum(o1) * o1 * tol;
  return min <= o2 && o2 <= max;
}
it.geosolutions.jaiext.piecewisePiecewiseUtilitiesgetTolerance

Javadoc

Gathers the tolerance for floating point comparisons

Popular methods of PiecewiseUtilities

  • createLinearTransform1D
    Create a linear transform mapping values from sampleValueRange to geophysicsValueRange.
  • compare
    Comparison between two double values
  • equals
  • hash
    Alters the given seed with the hash code value computed from the given value. The givan object may b
  • binarySearch
    Array binary search taking into account the fact that the input value to search can be NaN Note: Thi
  • deepHashCode
    Returns a hash code for the specified object, which may be an array. This method returns one of the
  • domainElementsOverlap
    Checks whether or not two DomainElement1Ds input range overlaps
  • doubleValue
    Returns a double value for the specified number. If direction is non-zero, then this method will ret
  • ensureNonNull
    Makes sure that an argument is non-null.
  • isSorted
    Checks if the array is sorted

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • getApplicationContext (Context)
  • startActivity (Activity)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Option (scala)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now