Comparer that compares two data elements of type SampledDataElement according to the distance of their input parameter vectors to a specified reference point (vector) in the input parameter 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...
List of all members.
Public Member Functions |
| ComparerInputDistance (IVector referencePoint, DistanceDelegate distanceFunction, bool immutable) |
| Constructs a new comparer according to input distance to a reference poiont (type IVector).
|
| ComparerInputDistance (IVector referencePoint, DistanceDelegate distanceFunction) |
| Constructs a new comparer according to input 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 input parameters (defined by the distance delegate of type DistanceDelegate) to the reference point.
|
virtual double | Distance (IVector v1, IVector v2) |
| Returns distance in the input parameters 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 input parameters space between input 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 input parameters space between input 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 input parameters 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 input parameters space between the specified data element's input 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 |
| ComparerInputDistance (IVector referencePoint, bool immutable) |
| Constructs a new comparer according to input 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 input parameters. Data elements are compared by the distance of their input vectors to this point.
|
DistanceDelegate | DistanceFunction [get, set] |
| Delegate that calculates distance between two vectors.
|
Private Member Functions |
| ComparerInputDistance () |
Private Attributes |
bool | _isImmutable = false |
Detailed Description
Comparer that compares two data elements of type SampledDataElement according to the distance of their input parameter vectors to a specified reference point (vector) in the input parameter 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::ComparerInputDistance::ComparerInputDistance |
( |
| ) |
[inline, private] |
IG::Num::SampledDataSet::ComparerInputDistance::ComparerInputDistance |
( |
IVector |
referencePoint, |
|
|
bool |
immutable |
|
) |
| [inline, protected] |
Constructs a new comparer according to input 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:
-
referencePoint | Reference point. Data elements are compared by their distance to this point. |
IG::Num::SampledDataSet::ComparerInputDistance::ComparerInputDistance |
( |
IVector |
referencePoint, |
|
|
DistanceDelegate |
distanceFunction, |
|
|
bool |
immutable |
|
) |
| [inline] |
Constructs a new comparer according to input distance to a reference poiont (type IVector).
- Parameters:
-
referencePoint | Reference point. Data elements are compared by their distance to this point. |
distanceFunction | Delegate used for calculation of distance between two points. |
immutable | If 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::ComparerInputDistance::ComparerInputDistance |
( |
IVector |
referencePoint, |
|
|
DistanceDelegate |
distanceFunction |
|
) |
| [inline] |
Constructs a new comparer according to input distance to a reference poiont (type IVector). Object constructed in this way is not immutable.
- Parameters:
-
referencePoint | Reference point. Data elements are compared by their distance to this point. |
distanceFunction | Delegate used for calculation of distance between two points. |
immutable | If 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
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 input parameters (defined by the distance delegate of type DistanceDelegate) to the reference point.
- Parameters:
-
el1 | The first data element to be compared. |
el2 | The 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 input parameters.
virtual double IG::Num::SampledDataSet::ComparerInputDistance::Distance |
( |
IVector |
v1, |
|
|
IVector |
v2 |
|
) |
| [inline, virtual] |
Returns distance in the input parameters space between two points, as defined by the distance calculation delegate of the current comparer object.
- Parameters:
-
v1 | The first point. |
v2 | The second point. |
Returns distance in the input parameters space between input vectors of two tarining elemets, as defined by the distance calculation delegate of the current comparer object.
- Parameters:
-
el1 | The first data element. |
el2 | The second data element. |
Returns distance in the input parameters space between input vector of the specified tarining elemet and the specified point, as defined by the distance calculation delegate of the current comparer object.
- Parameters:
-
el1 | The first data element. |
p2 | The second data element. |
double IG::Num::SampledDataSet::ComparerInputDistance::Distance |
( |
IVector |
v | ) |
[inline] |
Returns distance in the input parameters 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:
-
v | Vector whose distance to the reference point is returned. |
double IG::Num::SampledDataSet::ComparerInputDistance::Distance |
( |
SampledDataElement |
el | ) |
[inline] |
Returns distance in the input parameters space between the specified data element's input parameters vector and the reference point of the current comparer object, as defined by the distance calculation delegate of the current comparer object.
- Parameters:
-
el | Data element whose distance of input parameters to the reference point is returned. |
Member Data Documentation
Property Documentation
bool IG::Num::SampledDataSet::ComparerInputDistance::IsImmutable [get, set] |
Whether the current object is immutable or not.
IVector IG::Num::SampledDataSet::ComparerInputDistance::ReferencePoint [get, set] |
Reference point in the space of input parameters. Data elements are compared by the distance of their input vectors to this point.
DistanceDelegate IG::Num::SampledDataSet::ComparerInputDistance::DistanceFunction [get, set] |
Delegate that calculates distance between two vectors.
The documentation for this class was generated from the following file: