Fréchet View  1.6.0
A Tool for Exploring Fréchet Distance Algorithms
frechet::k::MappedInterval Class Reference

Detailed Description

attaches a component ID to an interval

In the k-Frechet algorithm, components are projected to domain axes. The MappedInterval class represents such a projection with the associated component identifier.

Author
Peter Schäfer

Definition at line 32 of file kalgorithm.h.

#include <kalgorithm.h>

Inherits frechet::data::Interval.

Public Member Functions

 MappedInterval ()
 empty constructor; creates an invalid interval More...
 
 MappedInterval (const Interval &ival, int compID)
 default constructor More...
 
bool operator< (const MappedInterval &that) const
 comparison operator, needed for sorting a list of MappedInterval objects. We first compare the lower bounds of both intervals. Next, we compare the upper bounds in reversed order (i.e. larger intervals are sorted in front of smaller ones) Thirdly, we compare compoent IDs. More...
 
bool operator== (const MappedInterval &that) const
 equality operator, needed for sorting a list of MappedInterval objects. More...
 
- Public Member Functions inherited from frechet::data::Interval
 Interval ()
 Default constructor. Creates an invalid Interval. More...
 
 Interval (double lower, double upper)
 Constructor from boundary values. More...
 
 Interval (const Interval &that)
 Copy constructor. More...
 
 Interval (const Interval &that, double shift)
 Copy constructor with shift offset. More...
 
double size () const
 size of the interval (upper - lower). More...
 
bool valid () const
 validity test More...
 
bool empty () const
 empty test More...
 
 operator bool () const
 
bool operator! () const
 
double lower () const
 
double upper () const
 
double & lower ()
 
double & upper ()
 
IntervalsetLower (double value)
 update lower bound More...
 
IntervalsetUpper (double value)
 update upper bound More...
 
double mid () const
 
Intervaloperator= (const Interval &that)
 assignment operator More...
 
bool operator== (const Interval &that) const
 equality comparator More...
 
bool equals (const Interval &that, double precision) const
 equalality comparator with tolerance More...
 
bool operator!= (const Interval &that) const
 non-equality comparator More...
 
Interval normalized () const
 normalized More...
 
Intervalnormalize ()
 make sure that lower <= upper, swapping bounds, if necessary More...
 
Intervalclear ()
 make this an invalid interval More...
 
bool contains (double x) const
 containment test (assumes closed interval, bounds inclusive) More...
 
bool contains (double x, double precision) const
 containment test with tolerance (assumes closed interval, bounds inclusive) More...
 
bool contains (const Interval &that) const
 containment test (closed interval, bounds inclusive) More...
 
bool intersects (const Interval &that) const
 intersection test (closed interval, bounds inclusive) More...
 
bool intersects_proper (const Interval &that) const
 intersection test (open interval, bounds exclusive) More...
 
bool bordersTo (const Interval &that) const
 adjacency test More...
 
double mapToUnitInterval (double x) const
 re-map a value from this interval to the unit interval More...
 
double mapFromUnitInterval (double x) const
 re-map a value from the unit interval to this interval More...
 
double mapTo (double x, const Interval &other) const
 re-map a value to another interval More...
 
double mapFrom (double x, const Interval &other) const
 re-map a value from another interval to this interval More...
 
Interval operator+ (double offset) const
 shift the interval by a fixed offset More...
 
Intervaloperator+= (double offset)
 shift the interval by a fixed offset More...
 
Interval operator- (double offset) const
 shift the interval by a fixed offset More...
 
Intervaloperator-= (double offset)
 shift the interval by a fixed offset More...
 
Interval operator * (double factor) const
 multiply by a factor More...
 
Intervaloperator *= (double factor)
 multiply by a factor More...
 
Interval operator/ (double factor) const
 divide by a factor More...
 
Intervaloperator/= (double factor)
 multiply by a factor More...
 
Interval operator+ (const Interval &that) const
 union operator More...
 
Intervaloperator+= (const Interval &that)
 union operator More...
 
Interval operator- (const Interval &that) const
 difference operator More...
 
Interval operator-= (const Interval &that)
 difference operator More...
 
Interval operator & (const Interval &that) const
 intersection operator More...
 
Intervaloperator&= (const Interval &that)
 intersection operator More...
 
Intervalunion_lf (const Interval &that)
 lock-free union operator; not used and not tested More...
 

Public Attributes

int componentID
 

Additional Inherited Members

- Static Public Member Functions inherited from frechet::data::Interval
static bool equals (double a, double b)
 equality comparator More...
 
- Static Public Attributes inherited from frechet::data::Interval
static const Interval UNIT
 the unit interval [0,1] More...
 
static const Interval INVALID = Interval ()
 an invalid interval (contains NAN values) More...
 

Constructor & Destructor Documentation

◆ MappedInterval() [1/2]

frechet::k::MappedInterval::MappedInterval ( )
inline

empty constructor; creates an invalid interval

Definition at line 39 of file kalgorithm.h.

◆ MappedInterval() [2/2]

frechet::k::MappedInterval::MappedInterval ( const Interval ival,
int  compID 
)
inline

default constructor

Parameters
ivala projection of a component to a domain axis
compIDthe associated component identifier

Definition at line 47 of file kalgorithm.h.

Member Function Documentation

◆ operator<()

bool MappedInterval::operator< ( const MappedInterval that) const

comparison operator, needed for sorting a list of MappedInterval objects. We first compare the lower bounds of both intervals. Next, we compare the upper bounds in reversed order (i.e. larger intervals are sorted in front of smaller ones) Thirdly, we compare compoent IDs.

Parameters
thatobject to compare with
Returns
true if (*this) < that

Definition at line 494 of file kalgorithm.cpp.

◆ operator==()

bool MappedInterval::operator== ( const MappedInterval that) const

equality operator, needed for sorting a list of MappedInterval objects.

Parameters
thatobject to compare with
Returns
true if this equals that

Definition at line 508 of file kalgorithm.cpp.

Member Data Documentation

◆ componentID

int frechet::k::MappedInterval::componentID

unique identifier of the component

See also
component_id_t

Definition at line 36 of file kalgorithm.h.


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