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

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Private Member Functions | Private Attributes

# 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:
[legend]

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:

  referencePoint | Reference 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:

  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::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:

  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

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:

  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 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:

  v1 | The first point.
  v2 | The 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:

  el1 | The first data element.
  el2 | The 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:

  el1 | The first data element.
  p2 | The 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:

  v | Vector 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:

  el | Data element whose distance of output values to the reference point is returned.

## 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`[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:

- SampledData.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events