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

+ Inheritance diagram for IG.Num.SampledDataSet.ComparerOutputDistance:
+ Collaboration diagram for IG.Num.SampledDataSet.ComparerOutputDistance:

Public Member Functions

 ComparerOutputDistance (IVector referencePoint, DistanceDelegate distanceFunction, bool immutable)
 Constructs a new comparer according to output distance to a reference poiont (type IVector). More...
 
 ComparerOutputDistance (IVector referencePoint, DistanceDelegate distanceFunction)
 Constructs a new comparer according to output distance to a reference poiont (type IVector). More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Protected Member Functions

 ComparerOutputDistance (IVector referencePoint, bool immutable)
 Constructs a new comparer according to output distance to a reference poiont (type IVector). More...
 

Protected Attributes

IVector _referencePoint
 
DistanceDelegate _distanceFunction
 

Properties

bool IsImmutable [get, protected set]
 Whether the current object is immutable or not. More...
 
IVector ReferencePoint [get, set]
 Reference point in the space of output values. More...
 
DistanceDelegate DistanceFunction [get, set]
 Delegate that calculates distance between two vectors. More...
 

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 ( )
inlineprivate
IG.Num.SampledDataSet.ComparerOutputDistance.ComparerOutputDistance ( IVector  referencePoint,
bool  immutable 
)
inlineprotected

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.

References IG.Num.VectorBase.Distance(), and IG.Num.IVector.GetCopy().

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.

References IG.Num.IVector.GetCopy().

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.

References IG.Num.SampledDataElement.OutputValues.

virtual double IG.Num.SampledDataSet.ComparerOutputDistance.Distance ( IVector  v1,
IVector  v2 
)
inlinevirtual

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.

References IG.Num.SampledDataElement.OutputValues.

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.

References IG.Num.SampledDataElement.OutputValues.

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.

References IG.Num.SampledDataElement.OutputValues.

Member Data Documentation

bool IG.Num.SampledDataSet.ComparerOutputDistance._isImmutable = false
private
IVector IG.Num.SampledDataSet.ComparerOutputDistance._referencePoint
protected
DistanceDelegate IG.Num.SampledDataSet.ComparerOutputDistance._distanceFunction
protected

Property Documentation

bool IG.Num.SampledDataSet.ComparerOutputDistance.IsImmutable
getprotected set

Whether the current object is immutable or not.

IVector IG.Num.SampledDataSet.ComparerOutputDistance.ReferencePoint
getset

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
getset

Delegate that calculates distance between two vectors.


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