Temporal slice shared by sliced tubes.
More...
#include <codac2_TSlice.h>
|
| | TSlice (const Interval &tdomain) |
| | Creates a temporal slice over the given time interval.
|
| | TSlice (const TSlice &tslice, const Interval &tdomain) |
| | Creates a temporal slice from another one over a new time interval.
|
| bool | is_gate () const |
| | Tests whether this temporal slice is a gate.
|
| const std::map< const SlicedTubeBase *, std::shared_ptr< SliceBase > > & | slices () const |
| | Returns the slices attached to this temporal slice.
|
| const Interval & | t0_tf () const |
| | Returns a read-only reference to the temporal interval.
|
| double | lb () const |
| | Returns the lower bound of this.
|
| double | ub () const |
| | Returns the upper bound of this.
|
| double | mid () const |
| | Returns the midpoint of this.
|
| double | rad () const |
| | Returns the radius of this.
|
| double | diam () const |
| | Returns the diameter of this.
|
| bool | is_empty () const |
| | Tests if this is empty.
|
| bool | is_unbounded () const |
| | Tests if one of the bounds of this is infinite.
|
| bool | is_degenerated () const |
| | Tests if this is degenerated, that is, in the form of \([a,a]\).
|
| bool | contains (const double &x) const |
| | Tests if this contains x.
|
| bool | intersects (const Interval &x) const |
| | Tests if this and x intersect.
|
| bool | is_subset (const Interval &x) const |
| | Tests if this is a subset of x.
|
| bool | is_superset (const Interval &x) const |
| | Tests if this is a superset of x.
|
|
|
std::map< const SlicedTubeBase *, std::shared_ptr< SliceBase > > | _slices |
| | Slices attached to each sliced tube over this temporal interval.
|
Temporal slice shared by sliced tubes.
A TSlice represents a temporal interval of a TDomain. It privately inherits from Interval so that only TDomain can modify its temporal bounds. It may correspond either to:
- a non-degenerate time slice \([t_i,t_{i+1}]\), or
- a degenerate interval \([t_i,t_i]\), referred to as a gate.
For each sliced tube defined on the same temporal partition, this object stores the corresponding SliceBase instance.
◆ TSlice() [1/2]
| codac2::TSlice::TSlice |
( |
const Interval & | tdomain | ) |
|
|
explicit |
Creates a temporal slice over the given time interval.
- Parameters
-
| tdomain | temporal interval associated with this slice |
◆ TSlice() [2/2]
| codac2::TSlice::TSlice |
( |
const TSlice & | tslice, |
|
|
const Interval & | tdomain ) |
Creates a temporal slice from another one over a new time interval.
This constructor duplicates the slice container associated with each tube by performing a deep copy of the underlying SliceBase objects.
- Parameters
-
| tslice | source temporal slice |
| tdomain | temporal interval associated with the copied slice |
◆ is_gate()
| bool codac2::TSlice::is_gate |
( |
| ) |
const |
Tests whether this temporal slice is a gate.
A temporal slice is considered as a gate when its temporal interval is degenerate, i.e., when \(t^-=t^+\).
- Returns
- true if this slice is a gate, false otherwise
◆ slices()
| const std::map< const SlicedTubeBase *, std::shared_ptr< SliceBase > > & codac2::TSlice::slices |
( |
| ) |
const |
Returns the slices attached to this temporal slice.
The returned map associates each SlicedTubeBase defined on the same temporal partition with its corresponding SliceBase over this temporal interval.
- Returns
- constant reference to the map of attached slices
◆ t0_tf()
| const Interval & codac2::TSlice::t0_tf |
( |
| ) |
const |
|
inline |
Returns a read-only reference to the temporal interval.
- Returns
- temporal interval of this slice
100 {
101 return *this;
102 }
◆ lb()
Returns the lower bound of this.
- Returns
- lower bound
127 {
128 return gaol::interval::left();
129 }
◆ ub()
Returns the upper bound of this.
- Returns
- upper bound
132 {
133 return gaol::interval::right();
134 }
◆ mid()
Returns the midpoint of this.
- Note
- The return point is guaranteed to be included in this but not necessarily to be the closest floating point from the real midpoint. In particular, cases are:
- [empty] -> Quiet NaN
- [-oo,+oo] -> mid = 0.0
- [-oo,b] -> mid = -MAXREAL
- [a,+oo] -> mid = MAXREAL
- [a,b] -> mid ~ a + .5*(b-a)
- Returns
- midpoint
137 {
138 double m = gaol::interval::midpoint();
139 gaol::round_upward();
140 return m;
141 }
◆ rad()
Returns the radius of this.
- Returns
- the radius, or 0 if this is empty
177 {
179 return std::numeric_limits<double>::quiet_NaN();
180
182 return oo;
183
184 else
185 {
187 double t1 = (t-*
this).
ub();
188 double t2 = (*
this-t).
ub();
189 return (t1>t2) ? t1 : t2;
190 }
191 }
bool is_unbounded() const
Tests if one of the bounds of this is infinite.
Definition codac2_Interval_impl.h:236
bool is_empty() const
Tests if this is empty.
Definition codac2_Interval_impl.h:221
double ub() const
Returns the upper bound of this.
Definition codac2_Interval_impl.h:131
double mid() const
Returns the midpoint of this.
Definition codac2_Interval_impl.h:136
◆ diam()
Returns the diameter of this.
- Returns
- the diameter, or 0 if this is empty
194 {
196 return std::numeric_limits<double>::quiet_NaN();
197
198 else
199 {
200 double d = gaol::interval::width();
201 gaol::round_upward();
202 return d;
203 }
204 }
◆ is_empty()
Tests if this is empty.
- Returns
- true in case of empty set
222 {
223 return gaol::interval::is_empty();
224 }
◆ is_unbounded()
Tests if one of the bounds of this is infinite.
- Note
- An empty interval is always bounded
- Returns
- true if of the bounds of this is infinite
237 {
238 return !gaol::interval::is_finite();
239 }
◆ is_degenerated()
Tests if this is degenerated, that is, in the form of \([a,a]\).
- Note
- An empty interval is considered here as degenerated
- Returns
- true if this is degenerated
242 {
243 return is_empty() || gaol::interval::is_a_double();
244 }
◆ contains()
Tests if this contains x.
- Note
- x can also be an "open bound", i.e., infinity. So this function is not restricted to a set-membership interpretation.
- Parameters
-
- Returns
- true if this contains x
227 {
228 return gaol::interval::set_contains(x);
229 }
◆ intersects()
Tests if this and x intersect.
- Parameters
-
- Returns
- true if the intervals intersect
257 {
258 return !
is_empty() && !x.is_empty() &&
lb() <= x.ub() &&
ub() >= x.lb();
259 }
double lb() const
Returns the lower bound of this.
Definition codac2_Interval_impl.h:126
◆ is_subset()
Tests if this is a subset of x.
- Note
- If this is empty, always returns true
- Parameters
-
- Returns
- true iff this interval is a subset of x
272 {
273 return is_empty() || (!x.is_empty() && x.lb() <=
lb() && x.ub() >=
ub());
274 }
◆ is_superset()
Tests if this is a superset of x.
- Note
- If this is empty, always returns true
- Parameters
-
- Returns
- true iff this interval is a superset of x
295 {
296 return x.is_subset(*this);
297 }
The documentation for this class was generated from the following file: