81 inline const SlicedTube<T>&
tube()
const
83 return static_cast<const SlicedTube<T>&
>(
_tube);
91 inline std::shared_ptr<SliceBase>
copy()
const override
93 return std::make_shared<Slice>(*
this, this->
_tube);
103 return this->T::size();
115 return static_cast<T&
>(*this);
125 return static_cast<const T&
>(*this);
147 return std::static_pointer_cast<const Slice<T>>(
158 return std::const_pointer_cast<Slice<T>>(
159 static_cast<const Slice<T>&
>(*this).prev_slice());
169 return std::static_pointer_cast<const Slice<T>>(
180 return std::const_pointer_cast<Slice<T>>(
181 static_cast<const Slice<T>&
>(*this).next_slice());
244 T x = *
this; x.set_empty();
245 auto bounds = std::make_pair(x,x);
269 bounds.first |= this->
lb();
270 bounds.second |= this->
ub();
285 inline void set(
const T& x,
bool propagate =
true)
287 assert_release(x.size() == this->size());
337 requires std::is_same_v<T,Interval>
346 Interval proj_output = input + d * v;
347 Interval proj_input = output - d * v;
349 return CtcDeriv::polygon_slice(
365 requires std::is_same_v<T,IntervalVector>
374 Interval proj_output = input + d * v[i];
375 Interval proj_input = output - d * v[i];
377 return CtcDeriv::polygon_slice(
432 requires (std::is_same_v<T,Interval> || std::is_same_v<T,IntervalVector>)
446 requires (std::is_same_v<T,Interval> || std::is_same_v<T,IntervalVector>)
448 if constexpr(std::is_same_v<T,Interval>)
451 else if constexpr(std::is_same_v<T,IntervalVector>)
455 for(Index i = 0 ; i <
size() ; i++)
473 else if(t.is_strict_superset(
t0_tf()))
517 if(t.is_empty() || y.is_empty())
520 else if(!t.is_subset(
t0_tf()))
525 if constexpr(std::is_same_v<T,Interval>)
528 else if constexpr(std::is_same_v<T,IntervalVector>)
531 for(Index i = 0 ; i <
size() ; i++)
581 template<
typename T_>
591 this->T::set_empty();
Represents a convex polygon defined by vertices enclosed in IntervalVectors.
Definition codac2_ConvexPolygon.h:25
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:49
bool is_empty() const
Tests if this is empty.
Definition codac2_Interval_impl.h:205
double ub() const
Returns the upper bound of this.
Definition codac2_Interval_impl.h:115
bool is_degenerated() const
Tests if this is degenerated, that is, in the form of .
Definition codac2_Interval_impl.h:225
bool is_subset(const Interval &x) const
Tests if this is a subset of x.
Definition codac2_Interval_impl.h:255
bool contains(const double &x) const
Tests if this contains x.
Definition codac2_Interval_impl.h:210
double lb() const
Returns the lower bound of this.
Definition codac2_Interval_impl.h:110
static Interval empty()
Provides an empty interval.
Definition codac2_Interval_impl.h:568
SliceBase(const SlicedTubeBase &tube, const std::list< TSlice >::iterator &it_tslice)
Creates a slice attached to a tube and a temporal slice.
std::list< TSlice >::iterator _it_tslice
Iterator to the associated temporal slice.
Definition codac2_SliceBase.h:115
const SlicedTubeBase & _tube
Parent sliced tube.
Definition codac2_SliceBase.h:110
const Interval & t0_tf() const
Returns the temporal domain of this slice.
std::shared_ptr< const SliceBase > next_slice() const
Returns the next slice of the same tube.
std::shared_ptr< const SliceBase > prev_slice() const
Returns the previous slice of the same tube.
Codomain of a sliced tube over one temporal slice.
Definition codac2_Slice.h:42
std::shared_ptr< Slice< T > > prev_slice()
Returns the previous slice.
Definition codac2_Slice.h:156
void set_empty(bool propagate)
Sets this codomain to the empty set.
Definition codac2_Slice.h:589
std::shared_ptr< const Slice< T > > next_slice() const
Returns the next slice.
Definition codac2_Slice.h:167
Slice(const SlicedTubeBase &tube, const std::list< TSlice >::iterator &it_tslice, const T &codomain)
Creates a slice attached to a tube over a temporal slice.
Definition codac2_Slice.h:52
Interval invert(const T &y, const Interval &t=Interval()) const
Returns the interval inversion .
Definition codac2_Slice.h:468
std::shared_ptr< SliceBase > copy() const override
Duplicates this slice.
Definition codac2_Slice.h:91
T operator()(const Interval &t) const
Returns the evaluation of this slice over .
Definition codac2_Slice.h:411
ConvexPolygon polygon_slice_i(const Slice< T > &v, Index i) const
Returns the polygonal enclosure associated with one component of a vector slice.
Definition codac2_Slice.h:364
Interval invert(const T &y, const Slice< T > &v, const Interval &t=Interval()) const
Returns the optimal interval inversion .
Definition codac2_Slice.h:514
bool is_gate() const
Tests whether this slice is a gate.
Definition codac2_Slice.h:135
T all_reals_value() const
Returns the unbounded value associated with this codomain type.
Definition codac2_Slice.h:559
T & codomain()
Returns a mutable reference to the codomain.
Definition codac2_Slice.h:113
std::shared_ptr< const Slice< T > > prev_slice() const
Returns the previous slice.
Definition codac2_Slice.h:145
T input_gate() const
Returns the input gate of this slice.
Definition codac2_Slice.h:194
bool operator==(const Slice &x) const
Compares two slices.
Definition codac2_Slice.h:322
const T & codomain() const
Returns a constant reference to the codomain.
Definition codac2_Slice.h:123
Slice(const Slice &s, const SlicedTubeBase &tube)
Creates a slice from another one for a given tube.
Definition codac2_Slice.h:65
void set_empty()
Sets this codomain to the empty set.
Definition codac2_Slice.h:309
Index size() const
Returns the codomain dimension.
Definition codac2_Slice.h:101
T output_gate() const
Returns the output gate of this slice.
Definition codac2_Slice.h:218
T operator()(double t, const Slice< T > &v) const
Returns the optimal evaluation of this slice at , based on the derivative information .
Definition codac2_Slice.h:431
T empty_value() const
Returns the empty value associated with this codomain type.
Definition codac2_Slice.h:571
T operator()(double t) const
Returns the evaluation of this slice at .
Definition codac2_Slice.h:390
std::pair< T, T > enclosed_bounds(const Interval &t) const
Returns enclosed lower and upper bounds over a temporal interval.
Definition codac2_Slice.h:242
ConvexPolygon polygon_slice(const Slice< T > &v) const
Returns the polygonal enclosure associated with this scalar slice.
Definition codac2_Slice.h:336
void update_adjacent_codomains()
Propagates codomain contractions to adjacent gates.
Definition codac2_Slice.h:602
std::shared_ptr< Slice< T > > next_slice()
Returns the next slice.
Definition codac2_Slice.h:178
const SlicedTube< T > & tube() const
Returns the sliced tube owning this slice.
Definition codac2_Slice.h:81
void init()
Initializes this codomain to its unbounded value.
Definition codac2_Slice.h:298
void set(const T &x, bool propagate=true)
Sets the codomain of this slice.
Definition codac2_Slice.h:285
T operator()(const Interval &t, const Slice< T > &v) const
Returns the optimal evaluation of this slice over , based on the derivative information .
Definition codac2_Slice.h:445
friend std::ostream & operator<<(std::ostream &os, const Slice &x)
Stream output for a slice.
Definition codac2_Slice.h:546
Base class for tubes defined over a sliced temporal domain.
Definition codac2_SlicedTubeBase.h:35
Tube represented over a sliced temporal domain.
Definition codac2_SlicedTube.h:38
bool is_subset(const Matrix< codac2::Interval, RowsAtCompileTime, ColsAtCompileTime > &x) const
Checks whether this matrix is a subset of another interval matrix.
Definition codac2_MatrixBase_addons_IntervalMatrixBase.h:678
bool contains(const Matrix< double, RowsAtCompileTime, ColsAtCompileTime > &x) const
Checks if this interval matrix contains the specified matrix x.
Definition codac2_MatrixBase_addons_IntervalMatrixBase.h:408
auto ub() const
Returns a matrix containing the upper bounds of each interval element.
Definition codac2_MatrixBase_addons_IntervalMatrixBase.h:103
auto lb() const
Returns a matrix containing the lower bounds of each interval element.
Definition codac2_MatrixBase_addons_IntervalMatrixBase.h:91
Definition codac2_OctaSym.h:21
Eigen::Matrix< Interval,-1, 1 > IntervalVector
Alias for a dynamic-size column vector of intervals.
Definition codac2_IntervalVector.h:25