Class MeshDistancesImpl

java.lang.Object
cz.fidentis.analyst.engines.distance.measurement.MeshDistancesImpl
All Implemented Interfaces:
MeshDistances, Serializable, Iterable<FacetDistances>

public class MeshDistancesImpl extends Object implements MeshDistances
The implementation of mesh distances.
See Also:
  • Constructor Details

    • MeshDistancesImpl

      public MeshDistancesImpl()
  • Method Details

    • addRawFacetMeasurement

      public FacetDistances addRawFacetMeasurement(RawFacetDistances facetDistances)
      Description copied from interface: MeshDistances
      Adds distance measurement for a facet. Previous measurement is returned, if exists.
      Specified by:
      addRawFacetMeasurement in interface MeshDistances
      Parameters:
      facetDistances - facet distance measurement without decorations (layers above).
      Returns:
      previous distance data for the facet or null
    • addLayer

      public void addLayer(FacetDistancesDecorator layer)
      Description copied from interface: MeshDistances
      Add a new layer (decorates a raw measurement or its top layer)
      Specified by:
      addLayer in interface MeshDistances
      Parameters:
      layer - New layer. Must not be null
    • clearLayers

      public void clearLayers()
      Description copied from interface: MeshDistances
      Removes all layers
      Specified by:
      clearLayers in interface MeshDistances
    • containsFacet

      public boolean containsFacet(MeshFacet meshFacet)
      Description copied from interface: MeshDistances
      Checks whether this measurement includes the given facet.
      Specified by:
      containsFacet in interface MeshDistances
      Parameters:
      meshFacet - mesh facet to be checked
      Returns:
      true if the facet is among the measured facets.
    • containsFacets

      public boolean containsFacets(Collection<MeshFacet> meshFacets)
      Description copied from interface: MeshDistances
      Checks whether this measurement includes all given facets.
      Specified by:
      containsFacets in interface MeshDistances
      Parameters:
      meshFacets - mesh facets to be checked
      Returns:
      true if all facets are among the measured facets.
    • getFacetMeasurement

      public FacetDistances getFacetMeasurement(MeshFacet meshFacet)
      Description copied from interface: MeshDistances
      Returns decorated distance measurement for the given facet or null
      Specified by:
      getFacetMeasurement in interface MeshDistances
      Parameters:
      meshFacet - required mesh facet
      Returns:
      the decorated distance measurement or null
    • distancesAsMap

      public Map<MeshFacet,List<Double>> distancesAsMap()
      Description copied from interface: MeshDistances
      Transforms FacetDistance objects into the map of the lists of distance values
      Specified by:
      distancesAsMap in interface MeshDistances
      Returns:
      a map of distance values for each measured facet (nearest neighbors are omitted)
    • weightsAsMap

      public Map<MeshFacet,List<Double>> weightsAsMap()
      Description copied from interface: MeshDistances
      Transforms FacetDistance objects into the map of the lists of weights
      Specified by:
      weightsAsMap in interface MeshDistances
      Returns:
      a map of weights for each measured facet (nearest neighbors are omitted)
    • stream

      public Stream<DistanceRecord> stream()
      Description copied from interface: MeshDistances
      Returns a stream of all decorated distance measurements (all vertices of all facets). The stream includes possible invalid measurements, i.e., point distances with infinite or NaN values, with missing nearing neighbors, etc. Use stream filtering to remove them.
      Specified by:
      stream in interface MeshDistances
      Returns:
      a stream of all decorated distance measurements (all vertices of all facets)
    • streamOfRawDistances

      public DoubleStream streamOfRawDistances()
      Description copied from interface: MeshDistances
      Returns a stream of raw distances (i.e., distances that were measured and are not affected by weights) of all vertices of all facets. The stream can include infinite numbers or NaNs values. Use stream filtering to remove them.
      Specified by:
      streamOfRawDistances in interface MeshDistances
      Returns:
      a stream of raw distances
    • streamOfWeightedDistances

      public DoubleStream streamOfWeightedDistances()
      Description copied from interface: MeshDistances
      Returns a stream of weighted distances (i.e., distances multiplied by their weight) of all vertices of all facets. The stream can include infinite numbers or NaNs values. Use stream filtering to remove them.
      Specified by:
      streamOfWeightedDistances in interface MeshDistances
      Returns:
      a stream of raw distances
    • getDistanceStats

      public DoubleSummaryStatistics getDistanceStats()
      Description copied from interface: MeshDistances
      Returns statistics of all distances. Only finite values are taken into account while infinite or NaN values are omitted from the calculation. Weights are ignored!
      Specified by:
      getDistanceStats in interface MeshDistances
      Returns:
      statistics of all computed distances.
    • getWeightedStats

      public DoubleSummaryStatistics getWeightedStats()
      Description copied from interface: MeshDistances
      Returns statistics of all distances. Only finite values are taken into account while infinite or NaN values are omitted from the calculation. The distances are multiplied by weights.
      Specified by:
      getWeightedStats in interface MeshDistances
      Returns:
      statistics of all computed distances.
    • getSampleStandardDeviation

      public double getSampleStandardDeviation()
      Description copied from interface: MeshDistances
      Returns corrected sample standard deviation. Only finite values are taken into account while infinite or NaN values are omitted from the calculation. Weights are ignored!
      Specified by:
      getSampleStandardDeviation in interface MeshDistances
      Returns:
      corrected sample standard deviation
    • iterator

      public Iterator<FacetDistances> iterator()
      Specified by:
      iterator in interface Iterable<FacetDistances>
      Specified by:
      iterator in interface MeshDistances