IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Num::PointCloud< PointContainerType, PointType > Class Template Reference

Cloud of points, contains a list of containers of objects that include point coordinates. More...

Inheritance diagram for IG::Num::PointCloud< PointContainerType, PointType >:
Collaboration diagram for IG::Num::PointCloud< PointContainerType, PointType >:

List of all members.

Public Member Functions

 PointCloud ()
 PointCloud (params PointType[] points)
 Constructs a cloud of points containing the specified points.
 PointCloud (params IPointContainer< PointType >[] points)
 Constructs a cloud of points containing the points embedded in the specified point containers. All points are taken from their point containers and embedded in newly created point containers before adding to the created cloud of points.
 PointCloud ()
 Constructs an empty cloud of points.
 PointCloud (params PointType[] points)
 Constructs a cloud of points containing the specified points.
 PointCloud (params IPointContainer< PointType >[] points)
 Constructs a cloud of points containing the points embedded in the specified point containers. All points are taken from their point containers and embedded in newly created point containers before adding to the created cloud of points.
PointContainerType GetPoint (int which)
 Returns the specified point identified by its position (index) within list of points.
void SetPoints (params PointType[] points)
 Sets the points to be contained in the current point cloud. Each point is embedded in a newly created point container.
void AddPoints (params PointType[] points)
 Adds the specified points to the current point cloud. Each added point is embedded in a newly created point container.
void SetPoints (params IPointContainer< PointType >[] points)
 Sets the points to be contained in the current point cloud to the specified set of points that are embedded in point containers. Each of the specified points is taken from its current container embedded in a newly created point container.
void AddPoints (params IPointContainer< PointType >[] points)
 Adds the specified points that are embedded in point containers to the current point cloud. Each of the specified points is taken from its current container embedded in a newly created point container.
abstract DistanceComparer
< PointContainerType,
PointType > 
CreateDefaultDistanceComparer (PointContainerType point)
 Creates and returnws a distance comparer of hte default type for the current type of point of clouds.
virtual DistanceComparer
< PointContainerType,
PointType > 
CreateDefaultDistanceComparer ()
 Creates and returnws a distance comparer of hte default type for the current type of point of clouds.
abstract PointType CreatePointFromCoordinates (IVector coordinates)
 Creates and returns a new point with specified coordinates.
abstract PointContainerType CreatePointContainer (PointType point)
 Creates and returns a new point container that wraps the specified point.
virtual PointContainerType CreatePointContainerFromCoordinates (IVector coordinates)
 Creates and returns a new point container that wraps a newly created point with the specified coordinates.

Parameters:
coordinatesCoordinates of the embedded point type. A copy of this vector is normally created to hold coordinates within the point, because the caller is allowed to modify coordinates on the vector.

List< PointContainerType > CreatePointsCopy ()
 Creates and returns a copy of list of points, containing references to points (point containers, in fact) contained in the current cloud of points.
PointType CreateRandomPoint (IBoundingBox bounds)
 Creates and returns a new point with random co-ordinates that fall within the specified bounds (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.
PointType CreateRandomPoint (int spaceDimension, double minCoordinateValues, double maxCoordinateValues)
 Creates and returns a new point with random co-ordinates that fall within the specified bounds (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.
PointType CreateRandomPoint (int spaceDimension)
 Creates and returns a new point with random co-ordinates that fall between 0 and 1 (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.
PointContainerType CreateRandomPointContainer (IBoundingBox bounds)
 Creates and returns a new point container with random co-ordinates that fall within the specified bounds (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.
PointContainerType CreateRandomPointContainer (int spaceDimension, double minCoordinateValues, double maxCoordinateValues)
 Creates and returns a new point container with random co-ordinates that fall within the specified bounds (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.
PointContainerType CreateRandomPointContainer (int spaceDimension)
 Creates and returns a new point container with random co-ordinates that fall between 0 and 1 (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.
void GenerateRandomCloud (int numPoints, IBoundingBox bounds)
 Generates a specified number of random points with random co-ordinates that fall within the specified bounds (inclusively), and incorporates them into the current point cloud. Eventual existent points are removed from the cloud. Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.
void GenerateRandomCloud (int numPoints, int spaceDimension, double minCoordinateValues, double maxCoordinateValues)
 Generates a specified number of random points with random co-ordinates that fall within the specified bounds (inclusively), and incorporates them into the current point cloud. Eventual existent points are removed from the cloud. Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.
void GenerateRandomCloud (int numPoints, int spaceDimension)
 Generates a specified number of random points with random co-ordinates that fall between 0 and 1 (inclusively), and incorporates them into the current point cloud. Eventual existent points are removed from the cloud. Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.
void UpdateNeighborDistances (IDistanceComparer< PointContainerType, PointType > distanceComparer)
 Iterates through all points contained in the current cloud, and calculates and updates their distances to the containing point by the specified distance comparer.
void GetNeighborDistanceStatistics (int numClosestPoints, ref int[] numSpecimens, ref IVector minDistances, ref IVector maxDistances, ref IVector averageDistances)
 Calculates a number of statistics on the distances of the first specified number of closest neighbors to each point, and stores them to the provided storage. It is assumed htat distances to the master points are calculated and stored on neighbors (links), and that neighbors are sorted accorgding to ascending distances from their master point.Objects to store data are re-allocated if necessary.
void GetNeighborDistanceStatistics (int numClosestPoints, ref int[] numSpecimens, ref IVector minDistances, ref IVector maxDistances, ref IVector averageDistances, ref IVector standardDeviations, ref IVector averageAbsoluteDeviations, bool calculateDeviations)
 Calculates a number of statistics on the distances of the first specified number of closest neighbors to each point, and stores them to the provided storage. It is assumed htat distances to the master points are calculated and stored on neighbors (links), and that neighbors are sorted accorgding to ascending distances from their master point.Objects to store data are re-allocated if necessary.
void PrintNeighborDistanceStatistics (int numClosestPoints, bool calculateDeviations, IDistanceComparer< PointContainerType, PointType > distanceComparer)
 Calculates and prints a number of statistics on the distances of the first specified number of closest neighbors to each point, and stores them to the provided storage. It is assumed htat distances to the master points are calculated and stored on neighbors (links), and that neighbors are sorted accorgding to ascending distances from their master point.Objects to store data are re-allocated if necessary.
void TestClosestPointsWithOutputs (int numClosestPoints, bool printByComponents, bool printIndividualPointsComp, PointContainerType[] points, IDistanceComparer< PointContainerType, PointType > comparerInput, List< PointContainerType > trainingPoints)
 For each point (training element) in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written. Result of this test can give some rough feeling about filling of space (but very rough because anisotropy can not be detected in this way).
void FindClosestPointsDummy (IDistanceComparer< PointContainerType, PointType > comparer, int numClosestPoints)
 Finds the specified number fo closest points to each point contained in the current cloud, and updates the neighbor lists of points such that they contain links to these neighbors.
void FindClosestPointsDummy (IDistanceComparer< PointContainerType, PointType > comparer, int numClosestPoints, bool accelerateSortingByStoringDistances)
 Finds the specified number fo closest points to each point contained in the current cloud, and updates the neighbor lists of points such that they contain links to these neighbors.
void FindClosestPointsGraph (IDistanceComparer< PointContainerType, PointType > comparer, int numClosestPoints)
 Finds closest points by initializing with random neighbors and then gradually improving connections to neighbors.

Static Public Member Functions

static void TestClosestPoints (int numClosestPoints, bool printByComponents, PointContainerType[] referencePoints, IDistanceComparer< PointContainerType, PointType > comparerInput, List< PointContainerType > trainingPoints)
 For each point in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written. Result of this test can give some rough feeling about filling of space (but very rough because anisotropy can not be detected in this way).
static void TestClosestPoints (int numClosestPoints, bool printByComponents, bool printIndividualPointsComp, PointContainerType[] referencePoints, IDistanceComparer< PointContainerType, PointType > comparerInput, List< PointContainerType > trainingPoints)
 For each point in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written. For individual points, differences are not printed by components.Result of this test can give some rough feeling about filling of space (but very rough because anisotropy can not be detected in this way).
static PointCloudVector ExampleClosestPointsDummy (int numPoints, int spaceDimension, int numClosestPoints)
 Creates rabndomly an example cloud of points, calculates the specified number of closest neighbors by the dummy method for each point in an example cloud, and prints statistics. Sorting is accellerated by storing distances to reference points and using them in comparison.
static PointCloudVector ExampleClosestPointsDummy (int numPoints, int spaceDimension, int numClosestPoints, bool accelerateSortingByStoringDistances)
 Creates randomly an example cloud of points, calculates the specified number of closest neighbors by the dummy method for each point in an example cloud, and prints statistics.

Public Attributes

DistanceComparer
< PointContainerType,
PointType > 
_distanceComparer

Protected Member Functions

void PrintNeighborDistanceStatistics (int[] numSpecimens, IVector minDistances, IVector maxDistances, IVector averageDistances, IVector standardDeviations, IVector averageAbsoluteDeviations, bool calculateDeviations)
void PrintNeighborDistanceStatistics (int[] numSpecimens, IVector minDistances, IVector maxDistances, IVector averageDistances)

Protected Attributes

internal object _lock = new object()
List< PointContainerType > _points = new List<PointContainerType>()
IVector _auxVector

Properties

object Lock [get]
 This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.
List< PointContainerType > Points [get]
 List of points contained on the current class.
int NumPoints [get]
 Gets the current number of points on the list.
PointContainerType this [int which] [get, set]
 Returns the specified point identified by its position (index) within list of points.
DistanceComparer
< PointContainerType,
PointType > 
DistanceComparer [get, set]
 Distance comparer of the current point cloud object. Getter has lazy evaluation (The default distance comparer is created the first time when needed by the CreateDefaultDistanceComparer mathod if distance comparer has not ben set before).
IRandomGenerator Rand [get, set]
 Random generator used by the current cloud of points.

Private Attributes

IRandomGenerator _rand

Detailed Description

template<PointContainerType, PointType>
class IG::Num::PointCloud< PointContainerType, PointType >

Cloud of points, contains a list of containers of objects that include point coordinates.

Template Parameters:
PointContainerTypeType of point link that is used by point container.
PointTypeType of objects that include point coordinates.

$A Igor Sep08 May09 Dec11;

Template Parameters:
PointLinkTypeType of point container used by the class.
PointContainerTypeType of point link that is used by point container.
PointTypeType of objects that include point coordinates.

This class as a part of group of classes that have been created in 2008 in order to support different operations and algorithms on losely connected clouds of points that are embedded in space of arbitrary dimension. The primary intended application was in optimization algorithms based on successive approximations of response and on restricted step prototype algorithms, developed by the author. The scope is much broader, however, because these classes can support closest neighbors algorithms, various graph algorithms based on points in space, detection of clusters, etc.

In 2009, major refactoring has been performed where a more generic structure has been introduced, allowing implementation of generic algorithm methods that can be used with different representations of points.

In 2011, the classes weer migrated from sandbox environment to the prduction IGLib library and simplified a bit. The intention is to use the classes in the artificial neural network-based approximation modules developed for COBIK and the University of Nova Gorica. The intention is, however, that the eventual algorithms developed within this scope are implemented in a generic way, such that they can serve multiple purposes.

$A Igor Sep08 May09 Dec11;

Type Constraints
PointContainerType :PointContainer 
PointContainerType :PointLink 
PointContainerType :PointContainerType 
PointContainerType :PointType 
PointContainerType :PointContainerType 
PointContainerType :PointType 

Member Function Documentation

template<PointContainerType , PointType >
IG::Num::PointCloud< PointContainerType, PointType >::PointCloud ( ) [inline]
template<PointContainerType , PointType >
IG::Num::PointCloud< PointContainerType, PointType >::PointCloud ( params PointType[]  points) [inline]

Constructs a cloud of points containing the specified points.

Parameters:
pointsPoints that are included in the created point cloud.
template<PointContainerType , PointType >
IG::Num::PointCloud< PointContainerType, PointType >::PointCloud ( params IPointContainer< PointType >[]  points) [inline]

Constructs a cloud of points containing the points embedded in the specified point containers. All points are taken from their point containers and embedded in newly created point containers before adding to the created cloud of points.

Parameters:
pointsPoints embedded in point containers that are included in the created point cloud.
template<PointContainerType , PointType >
IG::Num::PointCloud< PointContainerType, PointType >::PointCloud ( ) [inline]

Constructs an empty cloud of points.

template<PointContainerType , PointType >
IG::Num::PointCloud< PointContainerType, PointType >::PointCloud ( params PointType[]  points) [inline]

Constructs a cloud of points containing the specified points.

Parameters:
pointsPoints that are included in the created point cloud.
template<PointContainerType , PointType >
IG::Num::PointCloud< PointContainerType, PointType >::PointCloud ( params IPointContainer< PointType >[]  points) [inline]

Constructs a cloud of points containing the points embedded in the specified point containers. All points are taken from their point containers and embedded in newly created point containers before adding to the created cloud of points.

Parameters:
pointsPoints embedded in point containers that are included in the created point cloud.
template<PointContainerType , PointType >
PointContainerType IG::Num::PointCloud< PointContainerType, PointType >::GetPoint ( int  which) [inline]

Returns the specified point identified by its position (index) within list of points.

Parameters:
whichPoint index in the list.
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::SetPoints ( params PointType[]  points) [inline]

Sets the points to be contained in the current point cloud. Each point is embedded in a newly created point container.

Parameters:
pointsPoints to be contained in the current point cloud.
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::AddPoints ( params PointType[]  points) [inline]

Adds the specified points to the current point cloud. Each added point is embedded in a newly created point container.

Parameters:
pointsPoints embedded in point containers to be contained in the current point cloud.
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::SetPoints ( params IPointContainer< PointType >[]  points) [inline]

Sets the points to be contained in the current point cloud to the specified set of points that are embedded in point containers. Each of the specified points is taken from its current container embedded in a newly created point container.

Parameters:
pointsPoints to be contained in the current point cloud.
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::AddPoints ( params IPointContainer< PointType >[]  points) [inline]

Adds the specified points that are embedded in point containers to the current point cloud. Each of the specified points is taken from its current container embedded in a newly created point container.

Parameters:
pointsPoints embedded in point containers to be contained in the current point cloud.
template<PointContainerType , PointType >
abstract DistanceComparer<PointContainerType, PointType> IG::Num::PointCloud< PointContainerType, PointType >::CreateDefaultDistanceComparer ( PointContainerType  point) [pure virtual]

Creates and returnws a distance comparer of hte default type for the current type of point of clouds.

template<PointContainerType , PointType >
virtual DistanceComparer<PointContainerType, PointType> IG::Num::PointCloud< PointContainerType, PointType >::CreateDefaultDistanceComparer ( ) [inline, virtual]

Creates and returnws a distance comparer of hte default type for the current type of point of clouds.

template<PointContainerType , PointType >
abstract PointType IG::Num::PointCloud< PointContainerType, PointType >::CreatePointFromCoordinates ( IVector  coordinates) [pure virtual]

Creates and returns a new point with specified coordinates.

Parameters:
coordinatesCoordinates of the created point. A copy of this vector should always be created to hold coordinates within the point, because the caller is allowed to modify coordinates on the vector.

Implemented in IG::Num::PointCloudSampledDataElement, and IG::Num::PointCloudVector.

template<PointContainerType , PointType >
abstract PointContainerType IG::Num::PointCloud< PointContainerType, PointType >::CreatePointContainer ( PointType  point) [pure virtual]

Creates and returns a new point container that wraps the specified point.

Parameters:
pointPoint to be wrapped.
template<PointContainerType , PointType >
virtual PointContainerType IG::Num::PointCloud< PointContainerType, PointType >::CreatePointContainerFromCoordinates ( IVector  coordinates) [inline, virtual]

Creates and returns a new point container that wraps a newly created point with the specified coordinates.

Parameters:
coordinatesCoordinates of the embedded point type. A copy of this vector is normally created to hold coordinates within the point, because the caller is allowed to modify coordinates on the vector.

template<PointContainerType , PointType >
List<PointContainerType> IG::Num::PointCloud< PointContainerType, PointType >::CreatePointsCopy ( ) [inline]

Creates and returns a copy of list of points, containing references to points (point containers, in fact) contained in the current cloud of points.

Returns:
template<PointContainerType , PointType >
PointType IG::Num::PointCloud< PointContainerType, PointType >::CreateRandomPoint ( IBoundingBox  bounds) [inline]

Creates and returns a new point with random co-ordinates that fall within the specified bounds (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.

Parameters:
boundsBounds (inclusive) on co-ordinates of the generated points.
template<PointContainerType , PointType >
PointType IG::Num::PointCloud< PointContainerType, PointType >::CreateRandomPoint ( int  spaceDimension,
double  minCoordinateValues,
double  maxCoordinateValues 
) [inline]

Creates and returns a new point with random co-ordinates that fall within the specified bounds (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.

Parameters:
spaceDimensionDimension of generated point.
minCoordinateValuesMinimal value of co-ordinates (inclusive).
maxCoordinateValuesMaximal value of co-ordinates (inclusive).
template<PointContainerType , PointType >
PointType IG::Num::PointCloud< PointContainerType, PointType >::CreateRandomPoint ( int  spaceDimension) [inline]

Creates and returns a new point with random co-ordinates that fall between 0 and 1 (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.

Parameters:
spaceDimensionDimension of generated point.
template<PointContainerType , PointType >
PointContainerType IG::Num::PointCloud< PointContainerType, PointType >::CreateRandomPointContainer ( IBoundingBox  bounds) [inline]

Creates and returns a new point container with random co-ordinates that fall within the specified bounds (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.

Parameters:
boundsBounds (inclusive) on co-ordinates of the generated points.
template<PointContainerType , PointType >
PointContainerType IG::Num::PointCloud< PointContainerType, PointType >::CreateRandomPointContainer ( int  spaceDimension,
double  minCoordinateValues,
double  maxCoordinateValues 
) [inline]

Creates and returns a new point container with random co-ordinates that fall within the specified bounds (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.

Parameters:
spaceDimensionDimension of generated point.
minCoordinateValuesMinimal value of co-ordinates (inclusive).
maxCoordinateValuesMaximal value of co-ordinates (inclusive).
template<PointContainerType , PointType >
PointContainerType IG::Num::PointCloud< PointContainerType, PointType >::CreateRandomPointContainer ( int  spaceDimension) [inline]

Creates and returns a new point container with random co-ordinates that fall between 0 and 1 (inclusively). Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.

Parameters:
spaceDimensionDimension of generated point.
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::GenerateRandomCloud ( int  numPoints,
IBoundingBox  bounds 
) [inline]

Generates a specified number of random points with random co-ordinates that fall within the specified bounds (inclusively), and incorporates them into the current point cloud. Eventual existent points are removed from the cloud. Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.

Parameters:
boundsBounds (inclusive) on co-ordinates of the generated points.
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::GenerateRandomCloud ( int  numPoints,
int  spaceDimension,
double  minCoordinateValues,
double  maxCoordinateValues 
) [inline]

Generates a specified number of random points with random co-ordinates that fall within the specified bounds (inclusively), and incorporates them into the current point cloud. Eventual existent points are removed from the cloud. Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.

Parameters:
spaceDimensionDimension of generated point.
minCoordinateValuesMinimal value of co-ordinates (inclusive).
maxCoordinateValuesMaximal value of co-ordinates (inclusive).
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::GenerateRandomCloud ( int  numPoints,
int  spaceDimension 
) [inline]

Generates a specified number of random points with random co-ordinates that fall between 0 and 1 (inclusively), and incorporates them into the current point cloud. Eventual existent points are removed from the cloud. Object's internal random generator is used to create random co-ordinates. This random generator can be set through the Rand property.

Parameters:
spaceDimensionDimension of generated point.
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::UpdateNeighborDistances ( IDistanceComparer< PointContainerType, PointType >  distanceComparer) [inline]

Iterates through all points contained in the current cloud, and calculates and updates their distances to the containing point by the specified distance comparer.

template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::GetNeighborDistanceStatistics ( int  numClosestPoints,
ref int[]  numSpecimens,
ref IVector  minDistances,
ref IVector  maxDistances,
ref IVector  averageDistances 
) [inline]

Calculates a number of statistics on the distances of the first specified number of closest neighbors to each point, and stores them to the provided storage. It is assumed htat distances to the master points are calculated and stored on neighbors (links), and that neighbors are sorted accorgding to ascending distances from their master point.Objects to store data are re-allocated if necessary.

Parameters:
numClosestPointsNumber of closest neighbors for which statistics are calculated.
numSpecimensNumbers of actual samples for each k-th closest neighbor. I.e., the k-th element will store the number of points for which the k-th closest neighbor is actually defined.
minDistancesMinimal distances. The k-th element stores minimal distance of the k-th closest neighbor from its master over all points in the cloud.
maxDistancesMaximal distances. The k-th element stores maximal distance of the k-th closest neighbor from its master over all points in the cloud.
averageDistancesAverage distances. The k-th element stores average distance of the k-th closest neighbor from its master over all points in the cloud.
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::GetNeighborDistanceStatistics ( int  numClosestPoints,
ref int[]  numSpecimens,
ref IVector  minDistances,
ref IVector  maxDistances,
ref IVector  averageDistances,
ref IVector  standardDeviations,
ref IVector  averageAbsoluteDeviations,
bool  calculateDeviations 
) [inline]

Calculates a number of statistics on the distances of the first specified number of closest neighbors to each point, and stores them to the provided storage. It is assumed htat distances to the master points are calculated and stored on neighbors (links), and that neighbors are sorted accorgding to ascending distances from their master point.Objects to store data are re-allocated if necessary.

Parameters:
numClosestPointsNumber of closest neighbors for which statistics are calculated.
numSpecimensNumbers of actual samples for each k-th closest neighbor. I.e., the k-th element will store the number of points for which the k-th closest neighbor is actually defined.
minDistancesMinimal distances. The k-th element stores minimal distance of the k-th closest neighbor from its master over all points in the cloud.
maxDistancesMaximal distances. The k-th element stores maximal distance of the k-th closest neighbor from its master over all points in the cloud.
averageDistancesAverage distances. The k-th element stores average distance of the k-th closest neighbor from its master over all points in the cloud.
standardDeviationsStandard deviations of distances. The k-th element stores standard deviation of distance of the k-th closest neighbor from its master over all points in the cloud.
averageAbsoluteDeviationsAverage absolute deviations of distances. The k-th element stores average absolute deviation of distance of the k-th closest neighbor from its master over all points in the cloud.
calculateDeviationsSpecifies whether the standard deviation and average absolute deviations of distances are also calculated.
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::PrintNeighborDistanceStatistics ( int[]  numSpecimens,
IVector  minDistances,
IVector  maxDistances,
IVector  averageDistances,
IVector  standardDeviations,
IVector  averageAbsoluteDeviations,
bool  calculateDeviations 
) [inline, protected]
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::PrintNeighborDistanceStatistics ( int[]  numSpecimens,
IVector  minDistances,
IVector  maxDistances,
IVector  averageDistances 
) [inline, protected]
template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::PrintNeighborDistanceStatistics ( int  numClosestPoints,
bool  calculateDeviations,
IDistanceComparer< PointContainerType, PointType >  distanceComparer 
) [inline]

Calculates and prints a number of statistics on the distances of the first specified number of closest neighbors to each point, and stores them to the provided storage. It is assumed htat distances to the master points are calculated and stored on neighbors (links), and that neighbors are sorted accorgding to ascending distances from their master point.Objects to store data are re-allocated if necessary.

Parameters:
numClosestPointsNumber of closest neighbors for which statistics are calculated.
calculateDeviationsSpecifies whether the standard deviation and average absolute deviations of distances are also calculated.
distanceComparerDistance comparer used to calculate distances and to compare points.
template<PointContainerType , PointType >
static void IG::Num::PointCloud< PointContainerType, PointType >::TestClosestPoints ( int  numClosestPoints,
bool  printByComponents,
PointContainerType[]  referencePoints,
IDistanceComparer< PointContainerType, PointType >  comparerInput,
List< PointContainerType >  trainingPoints 
) [inline, static]

For each point in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written. Result of this test can give some rough feeling about filling of space (but very rough because anisotropy can not be detected in this way).

Parameters:
numClosestPointsNumber of closest points that are written.
includeVerificationPointsWhether verification points are included or not.
printByComponentsIf true then results are also printed by components.
referencePointsPoints that are checked for closest data points contained in the specified list of points.
comparerInputComparer object that calculates distance between points and compares compares points according to their distance to a reference point.

/

Parameters:
trainingPointsCloud of points that cover specific region of space and for which one wants to check how well the space is covered by these points.

$A Igor xx Jan12;

template<PointContainerType , PointType >
static void IG::Num::PointCloud< PointContainerType, PointType >::TestClosestPoints ( int  numClosestPoints,
bool  printByComponents,
bool  printIndividualPointsComp,
PointContainerType[]  referencePoints,
IDistanceComparer< PointContainerType, PointType >  comparerInput,
List< PointContainerType >  trainingPoints 
) [inline, static]

For each point in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written. For individual points, differences are not printed by components.Result of this test can give some rough feeling about filling of space (but very rough because anisotropy can not be detected in this way).

Parameters:
numClosestPointsNumber of closest points that are written.
includeVerificationPointsWhether verification points are included or not.
printByComponentsIf true then results are also printed by components.
printIndividualPointsCompIf true then individual components of differences are printed for individual points (otherwise, they are only printed in statistics).
referencePointsPoints that are checked for closest data points contained in the specified list of points.
comparerInputComparer object that calculates distance between points and compares compares points according to their distance to a reference point.
trainingPointsCloud of points that cover specific region of space and for which one wants to check how well the space is covered by these points.

$A Igor xx Jan12;

template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::TestClosestPointsWithOutputs ( int  numClosestPoints,
bool  printByComponents,
bool  printIndividualPointsComp,
PointContainerType[]  points,
IDistanceComparer< PointContainerType, PointType >  comparerInput,
List< PointContainerType >  trainingPoints 
) [inline]

For each point (training element) in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written. Result of this test can give some rough feeling about filling of space (but very rough because anisotropy can not be detected in this way).

Parameters:
numClosestPointsNumber of closest points that are written.
includeVerificationPointsWhether verification points are included or not.
printByComponentsIf true then results are also printed by components.
printIndividualPointsIf true then individual components of differences are printed for

Parameters:
pointsPoints that are checked for closest trainnig data points.
comparerInputComparer object that calculates distance between points and compares compares points according to their distance to a reference point.
trainingPointsCloud of points that cover specific region of space and for which one wants to check how well the space is covered by these points.

$A Igor xx Jan12;

template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::FindClosestPointsDummy ( IDistanceComparer< PointContainerType, PointType >  comparer,
int  numClosestPoints 
) [inline]

Finds the specified number fo closest points to each point contained in the current cloud, and updates the neighbor lists of points such that they contain links to these neighbors.

Parameters:
comparerComparer used to compare two points by distance to a reference point.

Used for sorting a list of all points according to their distance with the currently processed point.

Parameters:
numClosestPointsNumber of closest points to be identified for each point.

This method is a dummy approach, it is slow and has time efficiency of N^2*log2(N). However, the method finds exact closest points for all points in the cloud.

template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::FindClosestPointsDummy ( IDistanceComparer< PointContainerType, PointType >  comparer,
int  numClosestPoints,
bool  accelerateSortingByStoringDistances 
) [inline]

Finds the specified number fo closest points to each point contained in the current cloud, and updates the neighbor lists of points such that they contain links to these neighbors.

Parameters:
comparerComparer used to compare two points by distance to a reference point.

Used for sorting a list of all points according to their distance with the currently processed point.

Parameters:
numClosestPointsNumber of closest points to be identified for each point.
accelerateSortingByStoringDistancesIf true then quicker sorting approach that stores the distances to the reference point and compares points according to these values, is used.

This method is a dummy approach, it is slow and has time efficiency of N^2*log2(N). However, the method finds exact closest points for all points in the cloud.

template<PointContainerType , PointType >
void IG::Num::PointCloud< PointContainerType, PointType >::FindClosestPointsGraph ( IDistanceComparer< PointContainerType, PointType >  comparer,
int  numClosestPoints 
) [inline]

Finds closest points by initializing with random neighbors and then gradually improving connections to neighbors.

Parameters:
comparerDistance comparer used to sort points according to the distance to a reference point.
numClosestPointsNumber of closest points to detect.
template<PointContainerType , PointType >
static PointCloudVector IG::Num::PointCloud< PointContainerType, PointType >::ExampleClosestPointsDummy ( int  numPoints,
int  spaceDimension,
int  numClosestPoints 
) [inline, static]

Creates rabndomly an example cloud of points, calculates the specified number of closest neighbors by the dummy method for each point in an example cloud, and prints statistics. Sorting is accellerated by storing distances to reference points and using them in comparison.

Parameters:
numPointsNumber of points in the created random cloud.
spaceDimensionDimension of space in which points are embedded.
numClosestPointsNumber of closest points to each point.
Returns:
The pooint cloud of vectors that is generated and for which nearest neighbors are found.
template<PointContainerType , PointType >
static PointCloudVector IG::Num::PointCloud< PointContainerType, PointType >::ExampleClosestPointsDummy ( int  numPoints,
int  spaceDimension,
int  numClosestPoints,
bool  accelerateSortingByStoringDistances 
) [inline, static]

Creates randomly an example cloud of points, calculates the specified number of closest neighbors by the dummy method for each point in an example cloud, and prints statistics.

Parameters:
numPointsNumber of points in the created random cloud.
spaceDimensionDimension of space in which points are embedded.
numClosestPointsNumber of closest points to each point.
accelerateSortingByStoringDistancesIf true then sorting is accelerated by first calculating and storing distances on point containers and used the pre-calculated distances in comparison.

Member Data Documentation

template<PointContainerType , PointType >
internal object IG::Num::PointCloud< PointContainerType, PointType >::_lock = new object() [protected]
template<PointContainerType , PointType >
List<PointContainerType> IG::Num::PointCloud< PointContainerType, PointType >::_points = new List<PointContainerType>() [protected]
template<PointContainerType , PointType >
DistanceComparer<PointContainerType, PointType> IG::Num::PointCloud< PointContainerType, PointType >::_distanceComparer
template<PointContainerType , PointType >
IRandomGenerator IG::Num::PointCloud< PointContainerType, PointType >::_rand [private]
template<PointContainerType , PointType >
IVector IG::Num::PointCloud< PointContainerType, PointType >::_auxVector [protected]

Property Documentation

template<PointContainerType , PointType >
object IG::Num::PointCloud< PointContainerType, PointType >::Lock [get]

This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.

Implements IG::Lib::ILockable.

template<PointContainerType , PointType >
List<PointContainerType> IG::Num::PointCloud< PointContainerType, PointType >::Points [get]

List of points contained on the current class.

template<PointContainerType , PointType >
int IG::Num::PointCloud< PointContainerType, PointType >::NumPoints [get]

Gets the current number of points on the list.

template<PointContainerType , PointType >
PointContainerType IG::Num::PointCloud< PointContainerType, PointType >::this[int which] [get, set]

Returns the specified point identified by its position (index) within list of points.

Parameters:
whichPoint index in the list.
template<PointContainerType , PointType >
DistanceComparer<PointContainerType, PointType> IG::Num::PointCloud< PointContainerType, PointType >::DistanceComparer [get, set]

Distance comparer of the current point cloud object. Getter has lazy evaluation (The default distance comparer is created the first time when needed by the CreateDefaultDistanceComparer mathod if distance comparer has not ben set before).

template<PointContainerType , PointType >
IRandomGenerator IG::Num::PointCloud< PointContainerType, PointType >::Rand [get, set]

Random generator used by the current cloud of points.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events