Class MeshDistancesImpl
java.lang.Object
cz.fidentis.analyst.engines.distance.measurement.MeshDistancesImpl
- All Implemented Interfaces:
MeshDistances
,Serializable
,Iterable<FacetDistances>
The implementation of mesh distances.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayer
(FacetDistancesDecorator layer) Add a new layer (decorates a raw measurement or its top layer)addRawFacetMeasurement
(RawFacetDistances facetDistances) Adds distance measurement for a facet.void
Removes all layersboolean
containsFacet
(MeshFacet meshFacet) Checks whether this measurement includes the given facet.boolean
containsFacets
(Collection<MeshFacet> meshFacets) Checks whether this measurement includes all given facets.TransformsFacetDistance
objects into the map of the lists of distance valuesReturns statistics of all distances.getFacetMeasurement
(MeshFacet meshFacet) Returns decorated distance measurement for the given facet ornull
double
Returns corrected sample standard deviation.Returns statistics of all distances.iterator()
stream()
Returns a stream of all decorated distance measurements (all vertices of all facets).Returns a stream of raw distances (i.e., distances that were measured and are not affected by weights) of all vertices of all facets.Returns a stream of weighted distances (i.e., distances multiplied by their weight) of all vertices of all facets.TransformsFacetDistance
objects into the map of the lists of weightsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MeshDistancesImpl
public MeshDistancesImpl()
-
-
Method Details
-
addRawFacetMeasurement
Description copied from interface:MeshDistances
Adds distance measurement for a facet. Previous measurement is returned, if exists.- Specified by:
addRawFacetMeasurement
in interfaceMeshDistances
- Parameters:
facetDistances
- facet distance measurement without decorations (layers above).- Returns:
- previous distance data for the facet or
null
-
addLayer
Description copied from interface:MeshDistances
Add a new layer (decorates a raw measurement or its top layer)- Specified by:
addLayer
in interfaceMeshDistances
- Parameters:
layer
- New layer. Must not benull
-
clearLayers
public void clearLayers()Description copied from interface:MeshDistances
Removes all layers- Specified by:
clearLayers
in interfaceMeshDistances
-
containsFacet
Description copied from interface:MeshDistances
Checks whether this measurement includes the given facet.- Specified by:
containsFacet
in interfaceMeshDistances
- Parameters:
meshFacet
- mesh facet to be checked- Returns:
true
if the facet is among the measured facets.
-
containsFacets
Description copied from interface:MeshDistances
Checks whether this measurement includes all given facets.- Specified by:
containsFacets
in interfaceMeshDistances
- Parameters:
meshFacets
- mesh facets to be checked- Returns:
true
if all facets are among the measured facets.
-
getFacetMeasurement
Description copied from interface:MeshDistances
Returns decorated distance measurement for the given facet ornull
- Specified by:
getFacetMeasurement
in interfaceMeshDistances
- Parameters:
meshFacet
- required mesh facet- Returns:
- the decorated distance measurement or
null
-
distancesAsMap
Description copied from interface:MeshDistances
TransformsFacetDistance
objects into the map of the lists of distance values- Specified by:
distancesAsMap
in interfaceMeshDistances
- Returns:
- a map of distance values for each measured facet (nearest neighbors are omitted)
-
weightsAsMap
Description copied from interface:MeshDistances
TransformsFacetDistance
objects into the map of the lists of weights- Specified by:
weightsAsMap
in interfaceMeshDistances
- Returns:
- a map of weights for each measured facet (nearest neighbors are omitted)
-
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 interfaceMeshDistances
- Returns:
- a stream of all decorated distance measurements (all vertices of all facets)
-
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 interfaceMeshDistances
- Returns:
- a stream of raw distances
-
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 interfaceMeshDistances
- Returns:
- a stream of raw distances
-
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 interfaceMeshDistances
- Returns:
- statistics of all computed distances.
-
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 interfaceMeshDistances
- 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 interfaceMeshDistances
- Returns:
- corrected sample standard deviation
-
iterator
- Specified by:
iterator
in interfaceIterable<FacetDistances>
- Specified by:
iterator
in interfaceMeshDistances
-