IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
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. More...
Public Member Functions | |
ComparerInputDistance (IVector referencePoint, DistanceDelegate distanceFunction, bool immutable) | |
Constructs a new comparer according to input distance to a reference poiont (type IVector). More... | |
ComparerInputDistance (IVector referencePoint, DistanceDelegate distanceFunction) | |
Constructs a new comparer according to input 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 input parameters (defined by the distance delegate of type DistanceDelegate) to the reference point. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Protected Member Functions | |
ComparerInputDistance (IVector referencePoint, bool immutable) | |
Constructs a new comparer according to input 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 input parameters. More... | |
DistanceDelegate | DistanceFunction [get, set] |
Delegate that calculates distance between two vectors. More... | |
Private Member Functions | |
ComparerInputDistance () | |
Private Attributes | |
bool | _isImmutable = false |
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;
|
inlineprivate |
|
inlineprotected |
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.
referencePoint | Reference point. Data elements are compared by their distance to this point. |
References IG.Num.VectorBase.Distance(), and IG.Num.IVector.GetCopy().
|
inline |
Constructs a new comparer according to input distance to a reference poiont (type IVector).
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. |
References IG.Num.IVector.GetCopy().
|
inline |
Constructs a new comparer according to input distance to a reference poiont (type IVector).
Object constructed in this way is not immutable.
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. |
|
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 input parameters (defined by the distance delegate of type DistanceDelegate) to the reference point.
el1 | The first data element to be compared. |
el2 | The second data element to be compared. |
References IG.Num.SampledDataElement.InputParameters.
|
inlinevirtual |
Returns distance in the input parameters space between two points, as defined by the distance calculation delegate of the current comparer object.
v1 | The first point. |
v2 | The second point. |
|
inline |
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.
el1 | The first data element. |
el2 | The second data element. |
References IG.Num.SampledDataElement.InputParameters.
|
inline |
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.
el1 | The first data element. |
p2 | The second data element. |
References IG.Num.SampledDataElement.InputParameters.
|
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.
v | Vector whose distance to the reference point is returned. |
|
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.
el | Data element whose distance of input parameters to the reference point is returned. |
References IG.Num.SampledDataElement.InputParameters.
|
private |
|
protected |
|
protected |
|
getprotected set |
Whether the current object is immutable or not.
|
getset |
Reference point in the space of input parameters.
Data elements are compared by the distance of their input vectors to this point.
|
getset |
Delegate that calculates distance between two vectors.