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

IG::Num::SampledDataSet::ComparerOutputDistance Class Reference

Comparer that compares two data elements of type SampledDataElement according to the distance of their output values vectors to a specified reference point (vector) in the output values space. Measure of distance is defined by the DistanceDelegate delegate.Beside its basic comparison function, this class also contains a number of methods for calculation of distance between vectors or data elemets according to definition by the distacnce calculation delegate. More...

Collaboration diagram for IG::Num::SampledDataSet::ComparerOutputDistance:

List of all members.

Public Member Functions

 ComparerOutputDistance (IVector referencePoint, DistanceDelegate distanceFunction, bool immutable)
 Constructs a new comparer according to output distance to a reference poiont (type IVector).
 ComparerOutputDistance (IVector referencePoint, DistanceDelegate distanceFunction)
 Constructs a new comparer according to output distance to a reference poiont (type IVector). Object constructed in this way is not immutable.
override int Compare (SampledDataElement el1, SampledDataElement el2)
 Compares two data elemets and returns -1 if the first element is smaller than the second, 0 if they are equal and 1 if the first element is larger. Comparison is done accorging to the distance of the data element's output values (defined by the distance delegate of type DistanceDelegate) to the reference point.
virtual double Distance (IVector v1, IVector v2)
 Returns distance in the output values space between two points, as defined by the distance calculation delegate of the current comparer object.
double Distance (SampledDataElement el1, SampledDataElement el2)
 Returns distance in the output values space between output vectors of two tarining elemets, as defined by the distance calculation delegate of the current comparer object.
double Distance (SampledDataElement el1, IVector p2)
 Returns distance in the output values space between output vector of the specified tarining elemet and the specified point, as defined by the distance calculation delegate of the current comparer object.
double Distance (IVector v)
 Returns distance in the output values space between the specified vector and the reference point of the current comparer object, as defined by the distance calculation delegate of the current comparer object.
double Distance (SampledDataElement el)
 Returns distance in the output values space between the specified data element's output parameters vector and the reference point of the current comparer object, as defined by the distance calculation delegate of the current comparer object.

Protected Member Functions

 ComparerOutputDistance (IVector referencePoint, bool immutable)
 Constructs a new comparer according to output distance to a reference poiont (type IVector). Distance between two points is calculated as Euclidean distance.This method is protected because it is meant that distance delegate must be provided. However, classes can be derived that allow that distance delegate is not specified.

Protected Attributes

IVector _referencePoint
DistanceDelegate _distanceFunction

Properties

bool IsImmutable [get, set]
 Whether the current object is immutable or not.
IVector ReferencePoint [get, set]
 Reference point in the space of output values. Data elements are compared by the distance of their output vectors to this point.
DistanceDelegate DistanceFunction [get, set]
 Delegate that calculates distance between two vectors.

Private Member Functions

 ComparerOutputDistance ()

Private Attributes

bool _isImmutable = false

Detailed Description

Comparer that compares two data elements of type SampledDataElement according to the distance of their output values vectors to a specified reference point (vector) in the output values space.

Measure of distance is defined by the DistanceDelegate delegate.

Beside its basic comparison function, this class also contains a number of methods for calculation of distance between vectors or data elemets according to definition by the distacnce calculation delegate.

$A Igor Dec11;


Constructor & Destructor Documentation

IG::Num::SampledDataSet::ComparerOutputDistance::ComparerOutputDistance ( ) [inline, private]
IG::Num::SampledDataSet::ComparerOutputDistance::ComparerOutputDistance ( IVector  referencePoint,
bool  immutable 
) [inline, protected]

Constructs a new comparer according to output distance to a reference poiont (type IVector). Distance between two points is calculated as Euclidean distance.This method is protected because it is meant that distance delegate must be provided. However, classes can be derived that allow that distance delegate is not specified.

Parameters:
referencePointReference point. Data elements are compared by their distance to this point.
IG::Num::SampledDataSet::ComparerOutputDistance::ComparerOutputDistance ( IVector  referencePoint,
DistanceDelegate  distanceFunction,
bool  immutable 
) [inline]

Constructs a new comparer according to output distance to a reference poiont (type IVector).

Parameters:
referencePointReference point. Data elements are compared by their distance to this point.
distanceFunctionDelegate used for calculation of distance between two points.
immutableIf true then a copy of the reference point is stored internally rather than just its reference, so it can not be changed.
IG::Num::SampledDataSet::ComparerOutputDistance::ComparerOutputDistance ( IVector  referencePoint,
DistanceDelegate  distanceFunction 
) [inline]

Constructs a new comparer according to output distance to a reference poiont (type IVector). Object constructed in this way is not immutable.

Parameters:
referencePointReference point. Data elements are compared by their distance to this point.
distanceFunctionDelegate used for calculation of distance between two points.
immutableIf true then a copy of the reference point is stored internally rather than just its reference, so it can not be changed.

Member Function Documentation

override int IG::Num::SampledDataSet::ComparerOutputDistance::Compare ( SampledDataElement  el1,
SampledDataElement  el2 
) [inline]

Compares two data elemets and returns -1 if the first element is smaller than the second, 0 if they are equal and 1 if the first element is larger. Comparison is done accorging to the distance of the data element's output values (defined by the distance delegate of type DistanceDelegate) to the reference point.

Parameters:
el1The first data element to be compared.
el2The second data element to be compared.
Returns:
-1 if the first compared element is smaller than the second one, 0 if it is equal and 1 if it is greater than the cecond one, according to its distance to a reference point in space of outpu values.
virtual double IG::Num::SampledDataSet::ComparerOutputDistance::Distance ( IVector  v1,
IVector  v2 
) [inline, virtual]

Returns distance in the output values space between two points, as defined by the distance calculation delegate of the current comparer object.

Parameters:
v1The first point.
v2The second point.
double IG::Num::SampledDataSet::ComparerOutputDistance::Distance ( SampledDataElement  el1,
SampledDataElement  el2 
) [inline]

Returns distance in the output values space between output vectors of two tarining elemets, as defined by the distance calculation delegate of the current comparer object.

Parameters:
el1The first data element.
el2The second data element.
double IG::Num::SampledDataSet::ComparerOutputDistance::Distance ( SampledDataElement  el1,
IVector  p2 
) [inline]

Returns distance in the output values space between output vector of the specified tarining elemet and the specified point, as defined by the distance calculation delegate of the current comparer object.

Parameters:
el1The first data element.
p2The second data element.
double IG::Num::SampledDataSet::ComparerOutputDistance::Distance ( IVector  v) [inline]

Returns distance in the output values space between the specified vector and the reference point of the current comparer object, as defined by the distance calculation delegate of the current comparer object.

Parameters:
vVector whose distance to the reference point is returned.
double IG::Num::SampledDataSet::ComparerOutputDistance::Distance ( SampledDataElement  el) [inline]

Returns distance in the output values space between the specified data element's output parameters vector and the reference point of the current comparer object, as defined by the distance calculation delegate of the current comparer object.

Parameters:
elData element whose distance of output values to the reference point is returned.

Member Data Documentation


Property Documentation

bool IG::Num::SampledDataSet::ComparerOutputDistance::IsImmutable [get, set]

Whether the current object is immutable or not.

IVector IG::Num::SampledDataSet::ComparerOutputDistance::ReferencePoint [get, set]

Reference point in the space of output values. Data elements are compared by the distance of their output vectors to this point.

DistanceDelegate IG::Num::SampledDataSet::ComparerOutputDistance::DistanceFunction [get, set]

Delegate that calculates distance between two vectors.


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