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.PointContainer< PointLinkType, PointContainerType, PointType > Class Template Referenceabstract

Container class that contains a single point plus all the data that are necessary for searching and re-connecting operations on points. More...

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

Public Member Functions

 PointContainer (PointType point, int index)
 
 PointContainer (PointType point)
 
IVector GetPointCoordinates ()
 returns vector coo-rdinates (or input parameters) of the point contained in the current container. More...
 
abstract IVector GetPointCoordinates (PointType point)
 Returns vector of co-ordinates (or input parameters) of the specified point. More...
 
virtual IVector GetPointOutputVector (PointType point)
 Gets the vector of output values of the point contained in the current container. <pra>This method must be overridden in derived classes that use this functionality (not all point containers use it).</pra> More...
 
virtual IVector GetPointOutputVector ()
 Gets the vector of output values of the point containet in the current container. <pra>This method must be overridden in derived classes that use this functionality (not all point containers use it).</pra> More...
 
abstract PointLinkType CreateLink (PointContainerType point)
 Creates and returns a new link object that points to the specified point (indirectly through point container). More...
 

Protected Attributes

int _index
 
double _storedDistance
 

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...
 
PointType Point [get, protected set]
 Point that is enclosed by the current point container object. More...
 
static int NextPointId [get]
 Returns the next point ID that can be used for new PointContainer objects. More...
 
int Id [get, private set]
 Unique ID of the current point container (important also for testing and debugging). More...
 
List< PointLinkType > Neighbors [get]
 List of connected points ("neighbors"). More...
 
virtual int Index [get, set]
 Index of the current point in the original list of points where it can be accessed. More...
 
double StoredDistance [get, set]
 Stored distance to a reference point, which is used to increase performance of operations that perform comparison of point containers by the distance to some reference point. More...
 
- Properties inherited from IG.Num.IPointContainer< PointType >
PointType Point [get]
 Point that is enclosed by the current point container object. More...
 
int Id [get]
 Unique ID of the current point container (important also for testing and debugging). More...
 
int Index [get]
 Index of the current point in the original list of points where it can be accessed. More...
 
double StoredDistance [get, set]
 Stored distance to a reference point, which is used to increase performance of operations that perform comparison of point containers by the distance to some reference point. More...
 
- Properties inherited from IG.Lib.ILockable
object Lock [get]
 

Private Attributes

object _mainLock = new object()
 
PointType _point
 
int _id = NextPointId
 
List< PointLinkType > _neighbors = new List<PointLinkType>()
 

Static Private Attributes

static int _nextPointId = 0
 

Detailed Description

Container class that contains a single point plus all the data that are necessary for searching and re-connecting operations on points.

Template Parameters
PointLinkTypeType of point container used by the class.
PointContainerTypeType of point link that is used by point container.
PointTypeType of the point enclosed in this container class.

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.PointContainer< PointLinkType, PointContainerType, PointType >.PointContainer ( PointType  point,
int  index 
)
inline
IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.PointContainer ( PointType  point)
inline

Member Function Documentation

IVector IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.GetPointCoordinates ( )
inline

returns vector coo-rdinates (or input parameters) of the point contained in the current container.

Implements IG.Num.IPointContainer< PointType >.

abstract IVector IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.GetPointCoordinates ( PointType  point)
pure virtual

Returns vector of co-ordinates (or input parameters) of the specified point.

Parameters
pointPoint whose co-ordinates are returned.

Implements IG.Num.IPointContainer< PointType >.

virtual IVector IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.GetPointOutputVector ( PointType  point)
inlinevirtual

Gets the vector of output values of the point contained in the current container. <pra>This method must be overridden in derived classes that use this functionality (not all point containers use it).</pra>

This functionality is used only in those types of points that have input parameters and output values, such as approximation data points.

Implements IG.Num.IPointContainer< PointType >.

virtual IVector IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.GetPointOutputVector ( )
inlinevirtual

Gets the vector of output values of the point containet in the current container. <pra>This method must be overridden in derived classes that use this functionality (not all point containers use it).</pra>

This functionality is used only in those types of points that have input parameters and output values, such as approximation data points.

Implements IG.Num.IPointContainer< PointType >.

abstract PointLinkType IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.CreateLink ( PointContainerType  point)
pure virtual

Creates and returns a new link object that points to the specified point (indirectly through point container).

Parameters
pointPont at which the created link points.

Implemented in IG.Num.PointContainer< PointContainerType, PointType >.

Member Data Documentation

object IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >._mainLock = new object()
private
PointType IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >._point
private
int IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >._nextPointId = 0
staticprivate
int IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >._id = NextPointId
private
List<PointLinkType> IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >._neighbors = new List<PointLinkType>()
private
int IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >._index
protected
double IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >._storedDistance
protected

Property Documentation

object IG.Num.PointContainer< 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.

PointType IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.Point
getprotected set

Point that is enclosed by the current point container object.

int IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.NextPointId
staticget

Returns the next point ID that can be used for new PointContainer objects.

int IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.Id
getprivate set

Unique ID of the current point container (important also for testing and debugging).

List<PointLinkType> IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.Neighbors
get

List of connected points ("neighbors").

virtual int IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.Index
getset

Index of the current point in the original list of points where it can be accessed.

double IG.Num.PointContainer< PointLinkType, PointContainerType, PointType >.StoredDistance
getset

Stored distance to a reference point, which is used to increase performance of operations that perform comparison of point containers by the distance to some reference point.

Storing distance to a reference point can significantly speed up sorting operations where points are compared according to their distance to the specified reference point. Since CPU time spent for calculation of the distance is proportional to the dimension of space where points are embedded, we can save time if we only calculate the distance to a reference point once and then in all comparisons use the already calculated distance. For example, when sorting N point, on average N*log_2(N) comparisons of point pairs are performed, each of which would need to calculate distances of both compared points from the specified reference point. If we calculate the distances in advance and use stored distances in sorting, distance calculation is performed only N times. If N=1000, this means about ten times less distance calculations and almost 10 times less time for sorting in higher space dimensions.


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