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

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

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

origin: geotools/geotools

if (PiecewiseUtilities.compare(previousMax, q) != 0) {
  Range valueRange = RangeFactory.create(previousMax, true, q, false);
origin: it.geosolutions.jaiext.classifier/jt-classifier

@Override
public boolean equals(Object o) {
  if (this == o)
    return true;
  if (!(o instanceof LinearColorMap))
    return false;
  final LinearColorMap that = (LinearColorMap) o;
  if (!PiecewiseUtilities.equals(name, that.name))
    return false;
  if (!PiecewiseUtilities.equals(defaultColor, that.defaultColor))
    return false;
  if (preFilteringColor != that.preFilteringColor)
    return false;
  if (!PiecewiseUtilities.equals(preFilteringElements, that.preFilteringElements))
    return false;
  if (!PiecewiseUtilities.equals(standardElements, that.standardElements))
    return false;
  return piecewise.equals(that.piecewise);
}
origin: it.geosolutions.jaiext.classifier/jt-classifier

  @Override
  public int hashCode() {
    if (hashCode >= 0)
      return hashCode;
    hashCode = 37;
    hashCode = PiecewiseUtilities.hash(name, hashCode);
    hashCode = PiecewiseUtilities.hash(defaultColor, hashCode);
    hashCode = PiecewiseUtilities.hash(preFilteringColor, hashCode);
    hashCode = PiecewiseUtilities.hash(preFilteringElements, hashCode);
    hashCode = PiecewiseUtilities.hash(standardElements, hashCode);
    hashCode = PiecewiseUtilities.hash(piecewise, hashCode);
    return hashCode;
  }
}
origin: it.geosolutions.jaiext.piecewise/jt-piecewise

  @Override
  public int hashCode() {
    if (hashCode < 0) {
      int result = PiecewiseUtilities.deepHashCode(elements);
      result = PiecewiseUtilities.deepHashCode(minimums);
      result = PiecewiseUtilities.hash(getName(), result);
      hashCode = PiecewiseUtilities.hash(getApproximateDomainRange(), hashCode);

    }
    return hashCode;
  }
}
origin: it.geosolutions.jaiext.piecewise/jt-piecewise

final double minSource = doubleValue(sType, sourceRange.getMin(), sMinInc);
final double maxSource = doubleValue(sType, sourceRange.getMax(), sMaxInc);
final double minDestination = doubleValue(dType, destinationRange.getMin(), dMinInc);
final double maxDestination = doubleValue(dType, destinationRange.getMax(), dMaxInc);
if (PiecewiseUtilities.compare(minDestination, maxDestination) == 0)
  return SingleDimensionTransformation.create(0, minDestination);
if (PiecewiseUtilities.compare(minSource, maxSource) == 0)
  throw new IllegalArgumentException("Impossible to map a single value to a range.");
  scale = 0;
final double offset = minDestination - scale * minSource;
return createLinearTransform1D(scale, offset);
origin: it.geosolutions.jaiext.piecewise/jt-piecewise

PiecewiseUtilities.ensureNonNull("DomainElement1D[]", inDomainElements);
    if (PiecewiseUtilities.compare(inMinimum, previous.getInputMaximum()) <= 0) {
      PiecewiseUtilities.domainElementsOverlap(elements, i);
assert PiecewiseUtilities.isSorted(elements);
origin: geotools/geotools

"t0",
RangeFactory.create(0.0, true, 1.0, true),
PiecewiseUtilities.createLinearTransform1D(
    RangeFactory.create(0.0, true, 1.0, true),
    RangeFactory.create(200, 201)));
origin: it.geosolutions.jaiext.piecewise/jt-piecewise

/**
 * Public constructor for building a {@link DomainElement1D} which applies the specified transformation on the values that fall into its
 * definition range.
 * 
 * @param name for this {@link DomainElement1D}.
 * @param valueRange for this {@link DomainElement1D}.
 * @param transform for this {@link DomainElement1D}.
 * @throws IllegalArgumentException
 */
public DefaultPiecewiseTransform1DElement(CharSequence name, Range valueRange,
    final MathTransformation transform) throws IllegalArgumentException {
  super(name, valueRange);
  // /////////////////////////////////////////////////////////////////////
  //
  // Initial checks
  //
  // /////////////////////////////////////////////////////////////////////
  PiecewiseUtilities.ensureNonNull("transform", transform);
  this.transform = transform;
}
origin: it.geosolutions.jaiext.piecewise/jt-piecewise

PiecewiseUtilities.ensureNonNull("name", name);
PiecewiseUtilities.ensureNonNull("range", inputRange);
  inputMinimumInf = true;
} else
  this.inputMinimum = PiecewiseUtilities.doubleValue(type, inputRange.getMin()
      .doubleValue(), minInc ? 0 : +1);
if (Double.isInfinite(tempMax)) {
  inputMaximumInf = true;
} else
  this.inputMaximum = PiecewiseUtilities.doubleValue(type, inputRange.getMax()
      .doubleValue(), maxInc ? 0 : -1);
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;
}
origin: geosolutions-it/jai-ext

final double minSource = doubleValue(sType, sourceRange.getMin(), sMinInc);
final double maxSource = doubleValue(sType, sourceRange.getMax(), sMaxInc);
final double minDestination = doubleValue(dType, destinationRange.getMin(), dMinInc);
final double maxDestination = doubleValue(dType, destinationRange.getMax(), dMaxInc);
if (PiecewiseUtilities.compare(minDestination, maxDestination) == 0)
  return SingleDimensionTransformation.create(0, minDestination);
if (PiecewiseUtilities.compare(minSource, maxSource) == 0)
  throw new IllegalArgumentException("Impossible to map a single value to a range.");
  scale = 0;
final double offset = minDestination - scale * minSource;
return createLinearTransform1D(scale, offset);
origin: geosolutions-it/jai-ext

PiecewiseUtilities.ensureNonNull("DomainElement1D[]", inDomainElements);
    if (PiecewiseUtilities.compare(inMinimum, previous.getInputMaximum()) <= 0) {
      PiecewiseUtilities.domainElementsOverlap(elements, i);
assert PiecewiseUtilities.isSorted(elements);
origin: geosolutions-it/jai-ext

PiecewiseUtilities.createLinearTransform1D(
    RangeFactory.create(0.0, true, 1.0, true, false),
    RangeFactory.create(200, true, 201, true)));
origin: geosolutions-it/jai-ext

  @Override
  public int hashCode() {
    if (hashCode < 0) {
      int result = PiecewiseUtilities.deepHashCode(elements);
      result = PiecewiseUtilities.deepHashCode(minimums);
      result = PiecewiseUtilities.hash(getName(), result);
      hashCode = PiecewiseUtilities.hash(getApproximateDomainRange(), hashCode);

    }
    return hashCode;
  }
}
origin: geosolutions-it/jai-ext

/**
 * Public constructor for building a {@link DomainElement1D} which applies the specified transformation on the values that fall into its
 * definition range.
 * 
 * @param name for this {@link DomainElement1D}.
 * @param valueRange for this {@link DomainElement1D}.
 * @param transform for this {@link DomainElement1D}.
 * @throws IllegalArgumentException
 */
public DefaultPiecewiseTransform1DElement(CharSequence name, Range valueRange,
    final MathTransformation transform) throws IllegalArgumentException {
  super(name, valueRange);
  // /////////////////////////////////////////////////////////////////////
  //
  // Initial checks
  //
  // /////////////////////////////////////////////////////////////////////
  PiecewiseUtilities.ensureNonNull("transform", transform);
  this.transform = transform;
}
origin: geosolutions-it/jai-ext

PiecewiseUtilities.ensureNonNull("name", name);
PiecewiseUtilities.ensureNonNull("range", inputRange);
  inputMinimumInf = true;
} else
  this.inputMinimum = PiecewiseUtilities.doubleValue(type, inputRange.getMin()
      .doubleValue(), minInc ? 0 : +1);
if (Double.isInfinite(tempMax)) {
  inputMaximumInf = true;
} else
  this.inputMaximum = PiecewiseUtilities.doubleValue(type, inputRange.getMax()
      .doubleValue(), maxInc ? 0 : -1);
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: it.geosolutions.jaiext.piecewise/jt-piecewise

boolean minInc = outRange.isMinIncluded();
boolean maxInc = outRange.isMaxIncluded();
outputMinimum = PiecewiseUtilities.doubleValue(type, outRange.getMin(), minInc ? 0 : +1);
outputMaximum = PiecewiseUtilities.doubleValue(type, outRange.getMax(), maxInc ? 0 : -1);
outputMinimumNaN = Double.isNaN(outputMinimum);
outputMaximumNaN = Double.isNaN(outputMaximum);
final int compareOutBounds = PiecewiseUtilities.compare(outputMinimum, outputMaximum);
    setTransform(PiecewiseUtilities.createLinearTransform1D(0, outputMinimum));
    setInverse(null);
    return;
    throw new IllegalArgumentException("Bad range defined");
final MathTransformation transform = PiecewiseUtilities.createLinearTransform1D(inRange,
    RangeFactory.create(outputMinimum, true, outputMaximum, true, true));
setTransform(transform);
final double scale = tempTransform.getScale();
if (Math.abs(scale) < 1E-6)
  if (PiecewiseUtilities.compare(getInputMaximum(), getInputMinimum()) == 0)
    setInverse(SingleDimensionTransformation.create(0, getInputMinimum()));
  else
origin: it.geosolutions.jaiext.piecewise/jt-piecewise

/**
 * Returns a hash value for this domain element. This value need not remain consistent between different implementations of the same class.
 * 
 */
public int hashCode() {
  if (hashCode >= 0)
    return hashCode;
  hashCode = 37;
  hashCode = PiecewiseUtilities.hash(name, hashCode);
  hashCode = PiecewiseUtilities.hash(range, hashCode);
  hashCode = PiecewiseUtilities.hash(inputMaximum, hashCode);
  hashCode = PiecewiseUtilities.hash(inputMinimum, hashCode);
  return hashCode;
}
origin: geosolutions-it/jai-ext

@Override
public boolean equals(Object o) {
  if (this == o)
    return true;
  if (!(o instanceof LinearColorMap))
    return false;
  final LinearColorMap that = (LinearColorMap) o;
  if (!PiecewiseUtilities.equals(name, that.name))
    return false;
  if (!PiecewiseUtilities.equals(defaultColor, that.defaultColor))
    return false;
  if (preFilteringColor != that.preFilteringColor)
    return false;
  if (!PiecewiseUtilities.equals(preFilteringElements, that.preFilteringElements))
    return false;
  if (!PiecewiseUtilities.equals(standardElements, that.standardElements))
    return false;
  return piecewise.equals(that.piecewise);
}
it.geosolutions.jaiext.piecewisePiecewiseUtilities

Javadoc

Convenience class to group utilities methods for DomainElement1D and Domain1D implmentations.

Most used methods

  • 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.
  • getTolerance
    Gathers the tolerance for floating point comparisons
  • isSorted
    Checks if the array is sorted
  • isSorted

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Notification (javax.management)
  • Github Copilot alternatives
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