IGLib  1.5
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
IG.Num.PointCloud< PointLinkType, PointContainerType, PointType > Class Template Referenceabstract

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

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

Public Member Functions

 PointCloud ()
 Constructs an empty cloud of points. More...
 
 PointCloud (params PointType[] points)
 Constructs a cloud of points containing the specified points. More...
 
 PointCloud (params IPointContainer< PointType >[] points)
 Constructs a cloud of points containing the points embedded in the specified point containers. More...
 
PointContainerType GetPoint (int which)
 Returns the specified point identified by its position (index) within list of points. More...
 
void SetPoints (params PointType[] points)
 Sets the points to be contained in the current point cloud. More...
 
void AddPoints (params PointType[] points)
 Adds the specified points to the current point cloud. More...
 
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. More...
 
void AddPoints (params IPointContainer< PointType >[] points)
 Adds the specified points that are embedded in point containers to the current point cloud. More...
 
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. More...
 
virtual DistanceComparer
< PointContainerType,
PointType > 
CreateDefaultDistanceComparer ()
 Creates and returnws a distance comparer of hte default type for the current type of point of clouds. More...
 
abstract PointType CreatePointFromCoordinates (IVector coordinates)
 Creates and returns a new point with specified coordinates. More...
 
abstract PointContainerType CreatePointContainer (PointType point)
 Creates and returns a new point container that wraps the specified point. More...
 
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.
More...
 
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. More...
 
PointType CreateRandomPoint (IBoundingBox bounds)
 Creates and returns a new point with random co-ordinates that fall within the specified bounds (inclusively). More...
 
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). More...
 
PointType CreateRandomPoint (int spaceDimension)
 Creates and returns a new point with random co-ordinates that fall between 0 and 1 (inclusively). More...
 
PointContainerType CreateRandomPointContainer (IBoundingBox bounds)
 Creates and returns a new point container with random co-ordinates that fall within the specified bounds (inclusively). More...
 
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). More...
 
PointContainerType CreateRandomPointContainer (int spaceDimension)
 Creates and returns a new point container with random co-ordinates that fall between 0 and 1 (inclusively). More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void FindClosestPointsGraph (IDistanceComparer< PointContainerType, PointType > comparer, int numClosestPoints)
 Finds closest points by initializing with random neighbors and then gradually improving connections to neighbors. More...
 

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. More...
 
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. More...
 
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. More...
 
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. More...
 

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

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. More...
 
List< PointContainerType > Points [get]
 List of points contained on the current class. More...
 
int NumPoints [get]
 Gets the current number of points on the list. More...
 
PointContainerType this[int which] [get, protected set]
 Returns the specified point identified by its position (index) within list of points. More...
 
DistanceComparer
< PointContainerType,
PointType > 
DistanceComparer [get, set]
 Distance comparer of the current point cloud object. More...
 
IRandomGenerator Rand [get, set]
 Random generator used by the current cloud of points. More...
 
- Properties inherited from IG.Lib.ILockable
object Lock [get]
 

Private Attributes

IRandomGenerator _rand
 

Detailed Description

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

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
PointLinkType :PointLink 
PointLinkType :PointLinkType 
PointLinkType :PointContainerType 
PointLinkType :PointType 
PointContainerType :PointContainer 
PointContainerType :PointLinkType 
PointContainerType :PointContainerType 
PointContainerType :PointType 

Constructor & Destructor Documentation

IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.PointCloud ( )
inline

Constructs an empty cloud of points.

IG.Num.PointCloud< PointLinkType, 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.
IG.Num.PointCloud< PointLinkType, 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.

Member Function Documentation

PointContainerType IG.Num.PointCloud< PointLinkType, 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.
void IG.Num.PointCloud< PointLinkType, 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.
void IG.Num.PointCloud< PointLinkType, 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.
void IG.Num.PointCloud< PointLinkType, 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.

References IG.Num.IPointContainer< PointType >.Point.

void IG.Num.PointCloud< PointLinkType, 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.

References IG.Num.IPointContainer< PointType >.Point.

abstract DistanceComparer<PointContainerType, PointType> IG.Num.PointCloud< PointLinkType, 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.

virtual DistanceComparer<PointContainerType, PointType> IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.CreateDefaultDistanceComparer ( )
inlinevirtual

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

abstract PointType IG.Num.PointCloud< PointLinkType, 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.PointCloudVector, and IG.Num.PointCloudSampledDataElement.

abstract PointContainerType IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.CreatePointContainer ( PointType  point)
pure virtual

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

Parameters
pointPoint to be wrapped.
virtual PointContainerType IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.CreatePointContainerFromCoordinates ( IVector  coordinates)
inlinevirtual

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> IG.Num.PointCloud< PointLinkType, 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
PointType IG.Num.PointCloud< PointLinkType, 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.

References IG.Num.IBoundingBox.Dimension, IG.Num.IBoundingBox.GetMax(), IG.Num.IBoundingBox.GetMin(), IG.Num.IBoundingBox.IsMaxDefined(), and IG.Num.IBoundingBox.IsMinDefined().

PointType IG.Num.PointCloud< PointLinkType, 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).
PointType IG.Num.PointCloud< PointLinkType, 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.
PointContainerType IG.Num.PointCloud< PointLinkType, 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.
PointContainerType IG.Num.PointCloud< PointLinkType, 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).
PointContainerType IG.Num.PointCloud< PointLinkType, 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.
void IG.Num.PointCloud< PointLinkType, 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.

Referenced by IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.ExampleClosestPointsDummy().

void IG.Num.PointCloud< PointLinkType, 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).
void IG.Num.PointCloud< PointLinkType, 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.
void IG.Num.PointCloud< PointLinkType, 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.

References IG.Num.IDistanceComparer< PointContainerType, PointType >.Distance().

void IG.Num.PointCloud< PointLinkType, 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.
void IG.Num.PointCloud< PointLinkType, 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.
void IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.PrintNeighborDistanceStatistics ( int[]  numSpecimens,
IVector  minDistances,
IVector  maxDistances,
IVector  averageDistances,
IVector  standardDeviations,
IVector  averageAbsoluteDeviations,
bool  calculateDeviations 
)
inlineprotected
void IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.PrintNeighborDistanceStatistics ( int[]  numSpecimens,
IVector  minDistances,
IVector  maxDistances,
IVector  averageDistances 
)
inlineprotected
void IG.Num.PointCloud< PointLinkType, 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.

References IG.Lib.StopWatch.Start(), IG.Lib.StopWatch.Stop(), and IG.Lib.StopWatch.Time.

static void IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.TestClosestPoints ( int  numClosestPoints,
bool  printByComponents,
PointContainerType[]  referencePoints,
IDistanceComparer< PointContainerType, PointType >  comparerInput,
List< PointContainerType >  trainingPoints 
)
inlinestatic

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;

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

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;

References IG.Num.IDistanceComparer< PointContainerType, PointType >.Distance(), IG.Num.IDistanceComparer< PointContainerType, PointType >.GetRelativeCoordinates(), IG.Num.IDistanceComparer< PointContainerType, PointType >.ReferencePoint, IG.Lib.StopWatch.Start(), IG.Lib.StopWatch.Stop(), IG.Num.VectorBase.Subtract(), IG.Lib.StopWatch.Time, IG.Num.IVector.ToString(), and IG.Lib.StopWatch.TotalTime.

void IG.Num.PointCloud< PointLinkType, 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;

References IG.Num.IDistanceComparer< PointContainerType, PointType >.Distance(), IG.Num.IDistanceComparer< PointContainerType, PointType >.GetOutputRelativeCoordinates(), IG.Num.IDistanceComparer< PointContainerType, PointType >.GetRelativeCoordinates(), IG.Num.IDistanceComparer< PointContainerType, PointType >.OutputDistance(), IG.Num.IDistanceComparer< PointContainerType, PointType >.ReferencePoint, IG.Lib.StopWatch.Start(), IG.Lib.StopWatch.Stop(), IG.Num.VectorBase.Subtract(), IG.Lib.StopWatch.Time, IG.Num.IVector.ToString(), and IG.Lib.StopWatch.TotalTime.

void IG.Num.PointCloud< PointLinkType, 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.

Referenced by IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.ExampleClosestPointsDummy().

void IG.Num.PointCloud< PointLinkType, 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.

References IG.Num.IDistanceComparer< PointContainerType, PointType >.Distance(), IG.Num.IDistanceComparer< PointContainerType, PointType >.ReferencePoint, IG.Num.IDistanceComparer< PointContainerType, PointType >.Sort(), and IG.Num.IDistanceComparer< PointContainerType, PointType >.StoredDistanceComparer.

void IG.Num.PointCloud< PointLinkType, 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.
static PointCloudVector IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.ExampleClosestPointsDummy ( int  numPoints,
int  spaceDimension,
int  numClosestPoints 
)
inlinestatic

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.
static PointCloudVector IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.ExampleClosestPointsDummy ( int  numPoints,
int  spaceDimension,
int  numClosestPoints,
bool  accelerateSortingByStoringDistances 
)
inlinestatic

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.

References IG.Num.VectorBase.Distance(), IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.FindClosestPointsDummy(), IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.GenerateRandomCloud(), IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.PrintNeighborDistanceStatistics(), IG.Lib.StopWatch.Start(), IG.Lib.StopWatch.Stop(), and IG.Lib.StopWatch.Time.

Member Data Documentation

List<PointContainerType> IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >._points = new List<PointContainerType>()
protected
DistanceComparer<PointContainerType, PointType> IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >._distanceComparer
IRandomGenerator IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >._rand
private
IVector IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >._auxVector
protected

Property Documentation

object IG.Num.PointCloud< PointLinkType, 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.

List<PointContainerType> IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.Points
get

List of points contained on the current class.

int IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.NumPoints
get

Gets the current number of points on the list.

PointContainerType IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.this[int which]
getprotected set

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

Parameters
whichPoint index in the list.
DistanceComparer<PointContainerType, PointType> IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.DistanceComparer
getset

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 IG.Num.PointCloud< PointLinkType, PointContainerType, PointType >.Rand
getset

Random generator used by the current cloud of points.


The documentation for this class was generated from the following file: