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

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

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

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

/**
 * @param sample
 * @return
 */
private int getDomainElementIndex(final double sample) {
  int i = -1;
  // Special 'binarySearch' for NaN
  i = PiecewiseUtilities.binarySearch(minimums, sample);
  if (i >= 0) {
    // The value is exactly equals to one of minimum,
    // or is one of NaN values. There is nothing else to do.
    assert Double.doubleToRawLongBits(sample) == Double.doubleToRawLongBits(minimums[i]);
    return i;
  }
  assert i == Arrays.binarySearch(minimums, sample) : i;
  // 'binarySearch' found the index of "insertion point" (-(insertion
  // point) - 1). The
  // insertion point is defined as the point at which the key would be
  // inserted into the list: the index of the first element greater than
  // the key, or list.size(), if all elements in the list are less than
  // the specified key. Note that this guarantees that the return value
  // will be >= 0 if and only if the key is found.
  i = -i - 1;
  return i;
}
origin: geosolutions-it/jai-ext

/**
 * @param sample
 * @return
 */
private int getDomainElementIndex(final double sample) {
  int i = -1;
  // Special 'binarySearch' for NaN
  i = PiecewiseUtilities.binarySearch(minimums, sample);
  if (i >= 0) {
    // The value is exactly equals to one of minimum,
    // or is one of NaN values. There is nothing else to do.
    assert Double.doubleToRawLongBits(sample) == Double.doubleToRawLongBits(minimums[i]);
    return i;
  }
  assert i == Arrays.binarySearch(minimums, sample) : i;
  // 'binarySearch' found the index of "insertion point" (-(insertion
  // point) - 1). The
  // insertion point is defined as the point at which the key would be
  // inserted into the list: the index of the first element greater than
  // the key, or list.size(), if all elements in the list are less than
  // the specified key. Note that this guarantees that the return value
  // will be >= 0 if and only if the key is found.
  i = -i - 1;
  return i;
}
it.geosolutions.jaiext.piecewisePiecewiseUtilitiesbinarySearch

Javadoc

Array binary search taking into account the fact that the input value to search can be NaN Note: This method is not private in order to allows testing by .

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
  • 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.
  • getTolerance
    Gathers the tolerance for floating point comparisons
  • 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 12 Jupyter Notebook extensions
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