![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
boundary interval in the reachability structure. Represents an interval on the boundary of the FreeSpace (bottom.left,top, or right)
Stores references to the corresponding intervals (l,h) on the opposite border.
Implements an intrusive double-linked-list. Intrusive lists are efficient, but it is important that each object is only contained in no more than one list !
Note: we keep an eye on memory footprint. sizeof(BoundarySegment)==64 is cache-friendly. Try to avoid sizeof > 64.
Also note that LinkedListElement has NO virtual destructor, since BoundarySegment does not need a destructor (and we can save 8 bytes for the vptr).
Definition at line 285 of file boundary.h.
#include <boundary.h>
Inherits frechet::data::LinkedListElement< BoundarySegment >, frechet::data::Interval, and frechet::reach::PointerInterval.
Public Member Functions | |
Pointer | createClone () const |
create an identical copy of this segment More... | |
Pointer | clone () const |
void | clearClone () const |
disconnect from clone. Does not release any memory. More... | |
BoundarySegment (const Interval &ival, Orientation ori, Direction dir, Type t, void *owner=nullptr) | |
default constructor More... | |
void | clear () |
clears pointers, keep interval bounds More... | |
bool | contains (double x) const |
containment test More... | |
bool | contains (Pointer p) const |
containment test More... | |
BoundarySegment & | operator= (const PointerInterval &lh) |
assigment operator from interval More... | |
bool | operator== (const BoundarySegment &that) const |
comparison operator More... | |
![]() | |
LinkedListElement () | |
empty constructor More... | |
BoundarySegment * | prev () const |
BoundarySegment * | next () const |
BoundarySegment * | next (bool forward) |
![]() | |
BLinkedListElement () | |
empty constructor More... | |
BLinkedListElement *& | prev () |
BLinkedListElement *& | next () |
![]() | |
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 () |
Interval & | setLower (double value) |
update lower bound More... | |
Interval & | setUpper (double value) |
update upper bound More... | |
double | mid () const |
Interval & | operator= (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... | |
Interval & | normalize () |
make sure that lower <= upper, swapping bounds, if necessary More... | |
Interval & | clear () |
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... | |
Interval & | operator+= (double offset) |
shift the interval by a fixed offset More... | |
Interval | operator- (double offset) const |
shift the interval by a fixed offset More... | |
Interval & | operator-= (double offset) |
shift the interval by a fixed offset More... | |
Interval | operator * (double factor) const |
multiply by a factor More... | |
Interval & | operator *= (double factor) |
multiply by a factor More... | |
Interval | operator/ (double factor) const |
divide by a factor More... | |
Interval & | operator/= (double factor) |
multiply by a factor More... | |
Interval | operator+ (const Interval &that) const |
union operator More... | |
Interval & | operator+= (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... | |
Interval & | operator&= (const Interval &that) |
intersection operator More... | |
Interval & | union_lf (const Interval &that) |
lock-free union operator; not used and not tested More... | |
![]() | |
PointerInterval () | |
empty constructor; constructs an invalid interval, with both pointers being nullptr More... | |
PointerInterval (Pointer a, Pointer b) | |
default constructor More... | |
operator bool () const | |
true if the interal is valid, i.e. both pointers are More... | |
bool | operator! () const |
PointerInterval & | operator= (const Pointer &p) |
assigment More... | |
PointerInterval & | swap (bool doit=true) |
conditional swap More... | |
PointerInterval | swapped () const |
bool | contains (Pointer p) const |
containment test More... | |
PointerInterval | normalized () const |
assumes identical orientation !! More... | |
PointerInterval | operator+ (const PointerInterval &that) const |
merge operator More... | |
bool | operator== (const PointerInterval &that) const |
comparison operator More... | |
void | clear () |
clear both pointer (assgin nullptr) More... | |
Public Attributes | |
Type | type |
reachability label More... | |
const Orientation | ori |
horizontal or vertical More... | |
const Direction | dir |
left/right or bottom/top More... | |
Pointer | clone |
points to a clone of this object More... | |
Pointer | _twin |
points to a segment on the opposite edge of the reachability structure. twins have the same boundary interval (but different l,h pointers) More... | |
![]() | |
Pointer | l |
points to the lowest segment of the interval More... | |
Pointer | h |
points to the highest segment of the interval More... | |
Private Member Functions | |
Pointer | twin (int hops) |
Private Attributes | |
struct { | |
union { | |
Pointer clone | |
points to a clone of this object More... | |
Pointer _twin | |
points to a segment on the opposite edge of the reachability structure. twins have the same boundary interval (but different l,h pointers) More... | |
} | |
} | temp |
temporary data used during merge and split operations More... | |
Friends | |
class | Structure |
Additional Inherited Members | |
![]() | |
static bool | equals (double a, double b) |
equality comparator More... | |
![]() | |
static const Interval | UNIT |
the unit interval [0,1] More... | |
static const Interval | INVALID = Interval () |
an invalid interval (contains NAN values) More... | |
![]() | |
BLinkedListElement * | link [2] |
double links (previous, next) More... | |
BoundarySegment::BoundarySegment | ( | const Interval & | ival, |
Orientation | ori, | ||
Direction | dir, | ||
Type | t, | ||
void * | owner = nullptr |
||
) |
default constructor
ival | free-space interval bounding this segment |
ori | is this a horizontal or vertical segment? |
dir | is is located in the bottom-left part, or in the top-right part of a reachability structure |
t | label that indicates of the interval is reachable, or not |
owner | for debugging only |
Definition at line 9 of file boundary.cpp.
|
inline |
clears pointers, keep interval bounds
Definition at line 359 of file boundary.h.
|
inline |
disconnect from clone. Does not release any memory.
Definition at line 335 of file boundary.h.
|
inline |
Definition at line 333 of file boundary.h.
|
inline |
containment test
x | a point in the free-space |
Definition at line 369 of file boundary.h.
|
inline |
containment test
p | pointer to an invterval |
Definition at line 377 of file boundary.h.
|
inline |
create an identical copy of this segment
Definition at line 326 of file boundary.h.
|
inline |
assigment operator from interval
lh | an interval |
Definition at line 385 of file boundary.h.
|
inline |
comparison operator
that | another segment |
Definition at line 395 of file boundary.h.
|
inlineprivate |
hops | distance (1=opposite, 2=...) |
Definition at line 309 of file boundary.h.
|
friend |
Definition at line 291 of file boundary.h.
Pointer frechet::reach::BoundarySegment::_twin |
points to a segment on the opposite edge of the reachability structure. twins have the same boundary interval (but different l,h pointers)
Definition at line 298 of file boundary.h.
Pointer frechet::reach::BoundarySegment::clone |
points to a clone of this object
Definition at line 295 of file boundary.h.
const Direction frechet::reach::BoundarySegment::dir |
left/right or bottom/top
Definition at line 319 of file boundary.h.
const Orientation frechet::reach::BoundarySegment::ori |
horizontal or vertical
Definition at line 318 of file boundary.h.
struct { ... } frechet::reach::BoundarySegment::temp |
temporary data used during merge and split operations
Type frechet::reach::BoundarySegment::type |
reachability label
Definition at line 317 of file boundary.h.