IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.
|
Container class that contains a single point plus all the data that are necessary for searching and re-connecting operations on points. More...
Public Member Functions | |
PointContainer (PointType point, int index) | |
PointContainer (PointType point) | |
override PointLink < PointContainerType, PointType > | CreateLink (PointContainerType point) |
Creates and returns a new link object that points to the specified point (indirectly through point container). | |
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. | |
abstract IVector | GetPointCoordinates (PointType point) |
Returns vector of co-ordinates (or input parameters) of the specified point. | |
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> | |
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> | |
abstract PointLinkType | CreateLink (PointContainerType point) |
Creates and returns a new link object that points to the specified point (indirectly through point container). | |
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. | |
PointType | Point [get, set] |
Point that is enclosed by the current point container object. | |
static int | NextPointId [get] |
Returns the next point ID that can be used for new PointContainer objects. | |
int | Id [get, set] |
Unique ID of the current point container (important also for testing and debugging). | |
List< PointLinkType > | Neighbors [get] |
List of connected points ("neighbors"). | |
virtual int | Index [get, set] |
Index of the current point in the original list of points where it can be accessed. | |
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. | |
Private Attributes | |
object | _mainLock = new object() |
PointType | _point |
int | _id = NextPointId |
List< PointLinkType > | _neighbors = new List<PointLinkType>() |
Static Private Attributes | |
static int | _nextPointId = 0 |
Container class that contains a single point plus all the data that are necessary for searching and re-connecting operations on points.
PointContainerType | Type of point link that is used by point container. |
PointType | Type of the point enclosed in this container class. |
$A Igor Sep08 May09 Dec11;
PointLinkType | Type of point container used by the class. |
PointContainerType | Type of point link that is used by point container. |
PointType | Type 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;
PointContainerType | : | PointContainer | |
PointContainerType | : | PointLink | |
PointContainerType | : | PointContainerType | |
PointContainerType | : | PointType | |
PointContainerType | : | PointContainerType | |
PointContainerType | : | PointType |
IG::Num::PointContainer< PointContainerType, PointType >::PointContainer | ( | PointType | point, |
int | index | ||
) | [inline] |
IG::Num::PointContainer< PointContainerType, PointType >::PointContainer | ( | PointType | point | ) | [inline] |
override PointLink<PointContainerType, PointType> IG::Num::PointContainer< PointContainerType, PointType >::CreateLink | ( | PointContainerType | point | ) | [inline] |
Creates and returns a new link object that points to the specified point (indirectly through point container).
point | Pont at which the created link points. |
IG::Num::PointContainer< PointContainerType, PointType >::PointContainer | ( | PointType | point, |
int | index | ||
) | [inline] |
IG::Num::PointContainer< PointContainerType, PointType >::PointContainer | ( | PointType | point | ) | [inline] |
IVector IG::Num::PointContainer< 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< PointContainerType, PointType >::GetPointCoordinates | ( | PointType | point | ) | [pure virtual] |
Returns vector of co-ordinates (or input parameters) of the specified point.
point | Point whose co-ordinates are returned. |
Implements IG::Num::IPointContainer< PointType >.
virtual IVector IG::Num::PointContainer< PointContainerType, PointType >::GetPointOutputVector | ( | PointType | point | ) | [inline, virtual] |
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< PointContainerType, PointType >::GetPointOutputVector | ( | ) | [inline, virtual] |
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< PointContainerType, PointType >::CreateLink | ( | PointContainerType | point | ) | [pure virtual] |
Creates and returns a new link object that points to the specified point (indirectly through point container).
point | Pont at which the created link points. |
object IG::Num::PointContainer< PointContainerType, PointType >::_mainLock = new object() [private] |
PointType IG::Num::PointContainer< PointContainerType, PointType >::_point [private] |
int IG::Num::PointContainer< PointContainerType, PointType >::_nextPointId = 0 [static, private] |
int IG::Num::PointContainer< PointContainerType, PointType >::_id = NextPointId [private] |
List<PointLinkType> IG::Num::PointContainer< PointContainerType, PointType >::_neighbors = new List<PointLinkType>() [private] |
int IG::Num::PointContainer< PointContainerType, PointType >::_index [protected] |
double IG::Num::PointContainer< PointContainerType, PointType >::_storedDistance [protected] |
object IG::Num::PointContainer< 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.
PointType IG::Num::PointContainer< PointContainerType, PointType >::Point [get, set] |
Point that is enclosed by the current point container object.
Implements IG::Num::IPointContainer< PointType >.
int IG::Num::PointContainer< PointContainerType, PointType >::NextPointId [static, get] |
Returns the next point ID that can be used for new PointContainer objects.
int IG::Num::PointContainer< PointContainerType, PointType >::Id [get, set] |
Unique ID of the current point container (important also for testing and debugging).
Implements IG::Num::IPointContainer< PointType >.
List<PointLinkType> IG::Num::PointContainer< PointContainerType, PointType >::Neighbors [get] |
List of connected points ("neighbors").
virtual int IG::Num::PointContainer< PointContainerType, PointType >::Index [get, set] |
Index of the current point in the original list of points where it can be accessed.
Implements IG::Num::IPointContainer< PointType >.
double IG::Num::PointContainer< PointContainerType, PointType >::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.
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.
Implements IG::Num::IPointContainer< PointType >.