15 : ori(anori), lower(l),upper(u)
61 Q_ASSERT(this->
ori==b.
ori);
91 Q_ASSERT(this->
ori==b.
ori);
106 return (
Bias)((uint8_t)a | (uint8_t)b);
118 Map::iterator i =
map.find(x);
123 i->second.bias |= bias;
150 Map::const_iterator i =
map.find(x);
151 Q_ASSERT(i !=
map.end());
157 Map::const_iterator i =
map.lower_bound(x);
160 Q_ASSERT(i !=
map.end());
161 Q_ASSERT(i->first >= x);
167 Q_ASSERT(i->first < x);
173 Map::const_iterator i =
map.upper_bound(x);
176 Q_ASSERT(i !=
map.end());
177 Q_ASSERT(i->first > x);
183 for(Map::iterator i=
map.begin(); i !=
map.end(); ++i)
194 if (
map.empty())
return;
196 Map::const_iterator i=
map.begin();
197 Map::const_iterator j=i;
200 result.reserve(
map.size());
201 for( ; j !=
map.end(); ++i,++j)
203 Q_ASSERT(i->second.index==result.size());
205 result.push_back(
Interval(i->first,i->first));
207 result.push_back(
Interval(i->first,j->first));
209 Q_ASSERT(i !=
map.end());
211 result.push_back(
Interval(i->first,i->first));
262 bool upperBoundInclusive)
const 269 if (upperBoundInclusive)
282 if ((upp.bias==
LOWER_UPPER) && upperBoundInclusive)
283 return IndexRange(ori, low.
index,upp.index+1);
285 return IndexRange(ori, low.
index,upp.index);
308 return map(b->
ori, *b,
true);
381 for(
int i=0; i < fs->n; ++i)
383 const Interval& L = fs->cell(i,0).L;
384 bool inside = (L.
lower()==0.0);
389 for(
int j=0; j < fs->m-1; ++j)
391 const Interval& L = fs->cell(i,j).L;
392 const Interval& L2 = fs->cell(i,j+1).L;
402 else if (L.
lower() > 0.0) {
405 inside = (L.
upper() >= 1.0) && (L2.
lower()==0.0);
409 Q_ASSERT(L.
lower()==0.0);
410 inside = (L.
upper() >= 1.0) && (L2.
lower()==0.0);
425 for(
int j=0; j < fs->m; ++j)
427 const Interval& B = fs->cell(0,j).B;
428 bool inside = (B.
lower()==0.0);
433 for(
int i=0; i < fs->n-1; ++i)
435 const Interval& B = fs->cell(i,j).B;
445 else if (B.
lower() > 0.0) {
448 inside = (B.
upper() >= 1.0) && (i+1 < fs->n) && (fs->cell(i+1,j).B.lower()==0.0);
452 Q_ASSERT(B.
lower()==0.0);
453 inside = (B.
upper() >= 1.0) && (i+1 < fs->n) && (fs->cell(i+1,j).B.lower()==0.0);
void createReverseMap(std::vector< Interval > &result) const
create a reverse mapping; mapping graph nodes to free-space intervals
void insert1(double x, Bias bias)
insert one value, with an optional bias. Initially will be mapped to an invalid Graph node....
Bias
bias of a GraphModel boundary (how shall we explain this?)
bool contains(int i) const
containment test
IndexRange mapClosest(Orientation ori, const Interval &ival) const
map a free-space interval to the closest graph nodes
GraphModelAxis axis[2]
horizontal and vertical mapping
Bias operator|(Bias a, Bias b)
union operator
int _max_index
maximum node index
void remove(double x)
remove a value
Bias bias
bias: inclusive to lower / upper interval
boundary is inclusive to adjacent upper interval
global definitions for all algorithms.
const BoundsIndex * lookupLarger(double x) const
look up a node that is larger than value
const Orientation ori
horizontal or vertical
int map_lower(Pointer p) const
map the lower bound of a reachability structure interval
GraphModelAxis()
empty constructor
IndexRange operator+(const IndexRange &b) const
union operator
IndexRange operator &(const IndexRange &b) const
intersection operator
int dim2(Orientation ori) const
IndexRange & operator-=(int offset)
shift operator
boundary interval in the reachability structure. Represents an interval on the boundary of the FreeSp...
bool intersects(const IndexRange &b) const
intersection test
IndexRange()
empty constructor
int upper
upper index (exclusive)
int index
index of node in reachability graph
int lower
lower index (inclusive)
int dim1(Orientation ori) const
mapping within a GraphModel
IndexRange operator-(int offset) const
shift operator
a range of node indices in a Reachability Graph
Orientation
Segment Orientation.
void insert2(double x, Bias bias)
insert a value plus value shifted by free-space width (so that we can model a double-free-space diagr...
IndexRange map(Orientation ori, const Interval &, bool upperBoundInclusive) const
map a free-space interval to a range of graph nodes
double min(double a, double b)
minimum function with checks for NAN
IndexRange & operator+=(const IndexRange &b)
union operator
boundary is inclusive to adjacent lower interval
const BoundsIndex & lookup(double x) const
look up a value and map it to a graph node
Bias & operator|=(Bias &a, Bias b)
union operator
bool operator!=(const IndexRange &that) const
comparison operator
IndexRange mergedHMask(const IndexRange &m1, const IndexRange &m2) const
merged two node ranges representing the horizontal masks of reachability graph (see frechet::reach::G...
IndexRange & operator&=(const IndexRange &b)
intersection operator
void init(Structure &prototype)
void indexify(int start)
assign graph node indexes to all values (intervals)
manages a mapping between free-space intervals (continous, floating point) to reachability graph node...
Orientation ori
horizontal or vertical part of the reachability structure?
std::vector< Interval > reversed[2]
reverse mapping from nodes to intervals (horizontal and vertical)
const BoundsIndex * lookupLowerEqual(double x) const
look up a node that is lower or equal to value
void initHorizontal(const FreeSpace::ptr fs)
set up the mappings for horizontal intervals
IndexRange shiftedHorizontally(const IndexRange &r) const
map a node range to its counterpart in the duplicated part of a double-free-space
int _dim
width or height of the free-space diagram
an interval of two double values.
boost::shared_ptr< FreeSpace > ptr
smart pointer to FreeSpace object
int map_upper(Pointer p) const
map the upper bound of a reachability structure interval
void initVertical(const FreeSpace::ptr fs)
set up the mappings for vertical intervals
bool operator==(const IndexRange &that) const
comparison operator
double max(double a, double b)
maximum function with checks for NAN