|
codac 2.0.0
|
Tube represented over a sliced temporal domain. More...
#include <codac2_SlicedTube.h>
Classes | |
| struct | iterator |
| Mutable iterator over the slices of this tube. More... | |
| struct | reverse_iterator |
| Mutable reverse iterator over the slices of this tube. More... | |
| struct | const_iterator |
| Constant iterator over the slices of this tube. More... | |
| struct | const_reverse_iterator |
| Constant reverse iterator over the slices of this tube. More... | |
Public Member Functions | |
| SlicedTube (const std::shared_ptr< TDomain > &tdomain, const T &codomain) | |
| Creates a sliced tube with constant codomain over all temporal slices. | |
| SlicedTube (const std::shared_ptr< TDomain > &tdomain, const AnalyticFunction< typename ExprType< T >::Type > &f) | |
| Creates a sliced tube by evaluating an analytic function on each temporal slice. | |
| template<typename V> | |
| SlicedTube (const std::shared_ptr< TDomain > &tdomain, const AnalyticTraj< V > &x) | |
| Creates a sliced tube by evaluating an analytic trajectory on each temporal slice. | |
| template<typename V> | |
| SlicedTube (const std::shared_ptr< TDomain > &tdomain, const SampledTraj< V > &x) | |
| Creates a sliced tube from a sampled trajectory. | |
| SlicedTube (const SlicedTube< T > &x) | |
| Copy constructor. | |
| SlicedTube & | operator= (const SlicedTube &x) |
| Assignment operator. | |
| Index | size () const |
| Returns the codomain dimension. | |
| virtual std::pair< Index, Index > | shape () const |
| Returns the matrix shape of this tube codomain. | |
| double | volume () const |
| Returns the volume of this tube. | |
| std::shared_ptr< Slice< T > > | first_slice () |
| Returns the first slice of this tube. | |
| std::shared_ptr< const Slice< T > > | first_slice () const |
| Returns the first slice of this tube. | |
| std::shared_ptr< Slice< T > > | last_slice () |
| Returns the last slice of this tube. | |
| std::shared_ptr< const Slice< T > > | last_slice () const |
| Returns the last slice of this tube. | |
| std::shared_ptr< Slice< T > > | slice (const std::list< TSlice >::iterator &it) |
| Returns the slice attached to a temporal iterator. | |
| std::shared_ptr< const Slice< T > > | slice (const std::list< TSlice >::const_iterator &it) const |
| Returns the slice attached to a temporal iterator. | |
| std::shared_ptr< Slice< T > > | slice (const std::list< TSlice >::reverse_iterator &it) |
| Returns the slice attached to a reverse temporal iterator. | |
| std::shared_ptr< const Slice< T > > | slice (const std::list< TSlice >::const_reverse_iterator &it) const |
| Returns the slice attached to a reverse temporal iterator. | |
| std::shared_ptr< Slice< T > > | slice (std::shared_ptr< TSlice > ptr) |
| Returns the slice attached to a temporal slice pointer. | |
| bool | is_empty () const |
| Tests whether this tube is empty. | |
| bool | is_unbounded () const |
| Tests whether this tube is unbounded. | |
| T | codomain () const |
| Returns the global codomain of this tube. | |
| T | operator() (const Interval &t) const |
| Evaluates this tube over a temporal interval. | |
| T | operator() (const Interval &t, const SlicedTube< T > &v) const |
| Returns the optimal evaluation over a temporal interval using a derivative tube. | |
| std::pair< T, T > | enclosed_bounds (const Interval &t) const |
| Returns enclosed lower and upper bounds over a temporal interval. | |
| void | set (const T &codomain) |
| Sets all codomains of this tube to the same value. | |
| void | set (const T &codomain, double t) |
| Sets the codomain at one temporal instant. | |
| void | set (const T &codomain, const Interval &t) |
| Sets the codomain over a temporal interval. | |
| void | set_ith_slice (const T &codomain, Index i) |
| Sets the codomain of the \(i\)-th stored slice. | |
| template<typename V> | |
| const SlicedTube< T > & | inflate (const V &rad) |
| Inflates this tube by a constant radius. | |
| template<typename V> | |
| const SlicedTube< T > & | inflate (const SampledTraj< V > &rad) |
| Inflates this tube by a time-varying sampled radius. | |
| SlicedTube< Interval > | operator[] (Index i) const |
| Extracts one scalar component of this tube. | |
| SlicedTube< IntervalVector > | subvector (Index i, Index j) const |
| Extracts a subvector of this tube. | |
| bool | operator== (const SlicedTube &x) const |
| Compares two sliced tubes. | |
| SlicedTube & | operator&= (const SlicedTube &x) |
| Intersects this tube with another one. | |
| AnalyticFunction< typename ExprType< T >::Type > | as_function () const |
| Returns an analytic wrapper of this tube, allowing to evaluate this tube as an operator in an analytic expression. | |
| Interval | invert (const T &y) const |
| Returns the interval inversion \(\left[[x]^{-1}([y])\right]\). | |
| Interval | invert (const T &y, const Interval &t) const |
| Returns the interval inversion \(\left[[x]^{-1}([y])\right]\). | |
| void | invert (const T &y, std::vector< Interval > &v_t) const |
| Computes the set of continuous values of the inversion \([x]^{-1}([y])\). | |
| void | invert (const T &y, std::vector< Interval > &v_t, const Interval &t) const |
| Computes the set of continuous values of the inversion \([x]^{-1}([y])\). | |
| Interval | invert (const T &y, const SlicedTube< T > &v) const |
| Returns the optimal interval inversion \(\left[[x]^{-1}([y])\right]\). | |
| Interval | invert (const T &y, const SlicedTube< T > &v, const Interval &t) const |
| Returns the optimal interval inversion \(\left[[x]^{-1}([y])\right]\). | |
| void | invert (const T &y, std::vector< Interval > &v_t, const SlicedTube< T > &v) const |
| Computes the set of continuous values of the optimal inversion \([x]^{-1}([y])\). | |
| void | invert (const T &y, std::vector< Interval > &v_t, const SlicedTube< T > &v, const Interval &t) const |
| Computes the set of continuous values of the optimal inversion \([x]^{-1}([y])\). | |
| SlicedTube< T > | primitive () const |
| Returns a primitive of this tube with zero initial condition. | |
| SlicedTube< T > | primitive (const T &x0) const |
| Returns a primitive of this tube with prescribed initial condition. | |
| T | integral (const Interval &t) const |
| Returns an enclosure of the integrals of this tube from \(t_0\) to \([t]\). | |
| T | integral (const Interval &t1, const Interval &t2) const |
| Returns an enclosure of the integrals of this tube between the time intervals \([t_1]\) and \([t_2]\). | |
| std::pair< T, T > | partial_integral (const Interval &t) const |
| Returns lower and upper enclosures of the integrals of this tube \([x](\cdot)=[x^-(\cdot),x^+(\cdot)]\) from \(t_0\) to \([t]\). | |
| std::pair< T, T > | partial_integral (const Interval &t1, const Interval &t2) const |
| Returns lower and upper enclosures of the integrals of this tube \([x](\cdot)=[x^-(\cdot),x^+(\cdot)]\) between \([t_1]\) and \([t_2]\). | |
| std::pair< SlicedTube< T >, SlicedTube< T > > | partial_primitives () const |
| Returns the primitives of the lower and upper bounds of this tube \([x](\cdot)=[x^-(\cdot),x^+(\cdot)]\). | |
| T | integral (const Interval &t, const std::pair< SlicedTube< T >, SlicedTube< T > > &primitives) const |
| Returns an enclosure of the integrals of this tube from \(t_0\) to \([t]\), using precomputed partial primitives. | |
| T | integral (const Interval &t1, const Interval &t2, const std::pair< SlicedTube< T >, SlicedTube< T > > &primitives) const |
| Returns an enclosure of the integrals of this tube between the time intervals \([t_1]\) and \([t_2]\), using precomputed partial primitives. | |
| std::pair< T, T > | partial_integral (const Interval &t, const std::pair< SlicedTube< T >, SlicedTube< T > > &primitives) const |
| Returns lower and upper enclosures of the integrals of this tube \([x](\cdot)=[x^-(\cdot),x^+(\cdot)]\) from \(t_0\) to \([t]\), using precomputed partial primitives. | |
| std::pair< T, T > | partial_integral (const Interval &t1, const Interval &t2, const std::pair< SlicedTube< T >, SlicedTube< T > > &primitives) const |
| Returns lower and upper enclosures of the integrals of this tube \([x](\cdot)=[x^-(\cdot),x^+(\cdot)]\) between \([t_1]\) and \([t_2]\), using precomputed partial primitives. | |
| T | all_reals_value () const |
| Returns the unbounded codomain value associated with T. | |
| T | empty_value () const |
| Returns the empty codomain value associated with T. | |
| SampledTraj< typename Scalar< T >::Type > | mid () const |
| Returns the approximated midpoint trajectory of this tube. | |
| iterator | begin () |
| Returns an iterator to the first temporal slice. | |
| iterator | end () |
| Returns an iterator past the last temporal slice. | |
| reverse_iterator | rbegin () |
| Returns a reverse iterator to the last temporal slice. | |
| reverse_iterator | rend () |
| Returns a reverse iterator past the first temporal slice. | |
| const_iterator | begin () const |
| Returns a constant iterator to the first temporal slice. | |
| const_iterator | end () const |
| Returns a constant iterator past the last temporal slice. | |
| const_reverse_iterator | rbegin () const |
| Returns a constant reverse iterator to the last temporal slice. | |
| const_reverse_iterator | rend () const |
| Returns a constant reverse iterator past the first temporal slice. | |
| Public Member Functions inherited from codac2::SlicedTubeBase | |
| SlicedTubeBase (const std::shared_ptr< TDomain > &tdomain) | |
| Creates a sliced tube over a given temporal domain. | |
| ~SlicedTubeBase () | |
| Destroys this sliced tube. | |
| size_t | nb_slices () const |
| Returns the number of temporal elements of this tube. | |
| std::shared_ptr< const SliceBase > | first_slice () const |
| Returns the first slice of this tube. | |
| std::shared_ptr< const SliceBase > | last_slice () const |
| Returns the last slice of this tube. | |
| Public Member Functions inherited from codac2::TubeBase | |
| TubeBase (const std::shared_ptr< TDomain > &tdomain) | |
| Creates a tube over a given temporal domain. | |
| const std::shared_ptr< TDomain > & | tdomain () const |
| Returns the temporal domain of this tube. | |
| Interval | t0_tf () const |
| Returns the global temporal interval of this tube. | |
Additional Inherited Members | |
| Protected Attributes inherited from codac2::TubeBase | |
| const std::shared_ptr< TDomain > | _tdomain |
| Shared temporal domain of this tube. | |
Tube represented over a sliced temporal domain.
A SlicedTube<T> is a tube whose temporal domain is represented by a shared TDomain made of TSlice objects.
For each temporal slice of this partition, the tube stores a Slice<T> describing the codomain of the tube over that temporal support.
The codomain type T is typically Interval or IntervalVector, or any custom domain implemented by the user.
| T | codomain type of the tube |
|
inlineexplicit |
Creates a sliced tube with constant codomain over all temporal slices.
|
inlineexplicit |
Creates a sliced tube by evaluating an analytic function on each temporal slice.
The function is evaluated on each temporal interval of the associated TDomain.
| tdomain | shared temporal domain of the tube |
| f | analytic function of one scalar variable |
|
inlineexplicit |
|
inlineexplicit |
Creates a sliced tube from a sampled trajectory.
| V | sampled value type |
| tdomain | shared temporal domain of the tube |
| x | sampled trajectory evaluated on each temporal slice |
|
inline |
Copy constructor.
The copied tube shares the same TDomain as the source tube.
| x | tube to be copied |
|
inline |
Assignment operator.
Both tubes are expected to share the same temporal domain object.
| x | source tube |
|
inline |
Returns the codomain dimension.
|
inlinevirtual |
Returns the matrix shape of this tube codomain.
For scalar codomains, the returned shape is {1,1}.
|
inline |
Returns the volume of this tube.
Only non-gate slices contribute to the volume.
|
inline |
Returns the first slice of this tube.
|
inline |
Returns the first slice of this tube.
|
inline |
Returns the last slice of this tube.
|
inline |
Returns the last slice of this tube.
|
inline |
Returns the slice attached to a temporal iterator.
|
inline |
Returns the slice attached to a temporal iterator.
|
inline |
Returns the slice attached to a reverse temporal iterator.
|
inline |
Returns the slice attached to a reverse temporal iterator.
|
inline |
Returns the slice attached to a temporal slice pointer.
This overload is mainly intended for language bindings.
| ptr | pointer to a temporal slice of the shared TDomain |
|
inline |
Tests whether this tube is empty.
A fast evaluation is done by considering gates first, then envelopes, which allows to quickly identify an empty set
|
inline |
Tests whether this tube is unbounded.
|
inline |
|
inline |
|
inline |
Returns the optimal evaluation over a temporal interval using a derivative tube.
| t | temporal interval |
| v | derivative tube such that \(\dot{x}(\cdot)\in[v](\cdot)\) |
|
inline |
Returns enclosed lower and upper bounds over a temporal interval.
| t | temporal interval |
|
inline |
Sets all codomains of this tube to the same value.
| codomain | new codomain |
|
inline |
|
inline |
|
inline |
|
inline |
Inflates this tube by a constant radius.
| V | radius type |
| rad | inflation radius |
|
inline |
Inflates this tube by a time-varying sampled radius.
| V | sampled radius type |
| rad | sampled inflation radius |
|
inline |
Extracts one scalar component of this tube.
| i | component index |
|
inline |
Extracts a subvector of this tube.
| i | first component index |
| j | last component index |
|
inline |
Compares two sliced tubes.
Two sliced tubes are equal if they share the same temporal partition and if all corresponding codomains are equal.
| x | tube to compare with |
|
inline |
Intersects this tube with another one.
Both tubes are expected to be defined over the same temporal partition.
| x | tube to intersect with |
|
inline |
Returns an analytic wrapper of this tube, allowing to evaluate this tube as an operator in an analytic expression.
|
inline |
Returns the interval inversion \(\left[[x]^{-1}([y])\right]\).
If the inversion results in several pre-images, their union is returned.
| y | interval codomain |
|
inline |
|
inline |
Returns the optimal interval inversion \(\left[[x]^{-1}([y])\right]\).
The knowledge of the derivative tube \([v](\cdot)\) allows a finer inversion. If the inversion results in several pre-images, their union is returned.
| y | interval codomain |
| v | derivative tube such that \(\dot{x}(\cdot)\in[v](\cdot)\) |
|
inline |
Computes the set of continuous values of the optimal inversion \([x]^{-1}([y])\).
The knowledge of the derivative tube \([v](\cdot)\) allows finer inversions.
| y | interval codomain |
| v_t | vector of the sub-tdomains \([t_k]\) for which \(\forall t\in[t_k] \mid x(t)\in[y], x(\cdot)\in[x](\cdot), \dot{x}(\cdot)\in[v](\cdot)\) |
| v | derivative tube such that \(\dot{x}(\cdot)\in[v](\cdot)\) |
| std::pair< SlicedTube< T >, SlicedTube< T > > codac2::SlicedTube< T >::partial_primitives | ( | ) | const |
Returns the primitives of the lower and upper bounds of this tube \([x](\cdot)=[x^-(\cdot),x^+(\cdot)]\).
The returned pair of tubes \(([p^-](\cdot),[p^+](\cdot))\) encloses the two functions defined by
\[ p^-(t)=\int_{t_0}^{t} x^-(s)\,ds, \qquad p^+(t)=\int_{t_0}^{t} x^+(s)\,ds. \]
Both tubes share this tube's temporal partition. Their codomains enclose the ranges of the affine primitives on each slice, and explicit gates enclose the cumulative integrals at sampling times. The gates of the source tube have zero duration and do not contribute to the integrals.
| T codac2::SlicedTube< T >::integral | ( | const Interval & | t, |
| const std::pair< SlicedTube< T >, SlicedTube< T > > & | primitives ) const |
Returns an enclosure of the integrals of this tube from \(t_0\) to \([t]\), using precomputed partial primitives.
This method computes an enclosure of
\[ \left\{ \int_{t_0}^{\tau} [x](s)\,ds \;\middle|\; \tau\in[t] \right\}. \]
It is obtained from partial_integral(t, primitives) by taking the hull between the lower bound of the lower enclosure and the upper bound of the upper enclosure.
| t | temporal interval \([t]\) |
| primitives | pair of tubes returned by partial_primitives() for this tube |
| T codac2::SlicedTube< T >::integral | ( | const Interval & | t1, |
| const Interval & | t2, | ||
| const std::pair< SlicedTube< T >, SlicedTube< T > > & | primitives ) const |
Returns an enclosure of the integrals of this tube between the time intervals \([t_1]\) and \([t_2]\), using precomputed partial primitives.
This method computes an enclosure of
\[ \left\{ \int_{\tau_1}^{\tau_2} [x](s)\,ds \;\middle|\; \tau_1\in[t_1],\ \tau_2\in[t_2] \right\}. \]
Let \(([p^-],[p^+])\) be the pair of partial integral enclosures returned by partial_integral(t1, t2, primitives). The result is obtained from their bounds according to the direction of integration:
\[ \begin{cases} [\inf[p^-],\sup[p^+]] & \text{if } \sup[t_1]\leq\inf[t_2],\\ [\inf[p^+],\sup[p^-]] & \text{if } \sup[t_2]\leq\inf[t_1],\\ [p^-]\sqcup[p^+] & \text{otherwise}. \end{cases} \]
| t1 | first temporal interval \([t_1]\) |
| t2 | second temporal interval \([t_2]\) |
| primitives | pair of tubes returned by partial_primitives() for this tube |
| std::pair< T, T > codac2::SlicedTube< T >::partial_integral | ( | const Interval & | t, |
| const std::pair< SlicedTube< T >, SlicedTube< T > > & | primitives ) const |
Returns lower and upper enclosures of the integrals of this tube \([x](\cdot)=[x^-(\cdot),x^+(\cdot)]\) from \(t_0\) to \([t]\), using precomputed partial primitives.
This method returns a pair \(([p^-],[p^+])\) such that:
\[ [p^-]\supset \left\{ \int_{t_0}^{\tau} x^-(s)\,ds \;\middle|\; \tau\in[t] \right\} \]
and
\[ [p^+]\supset \left\{ \int_{t_0}^{\tau} x^+(s)\,ds \;\middle|\; \tau\in[t] \right\}. \]
The enclosures are obtained by evaluating the precomputed primitives over \([t]\), using the affine evolution on each slice.
| t | temporal interval \([t]\) |
| primitives | pair of tubes returned by partial_primitives() for this tube |
| std::pair< T, T > codac2::SlicedTube< T >::partial_integral | ( | const Interval & | t1, |
| const Interval & | t2, | ||
| const std::pair< SlicedTube< T >, SlicedTube< T > > & | primitives ) const |
Returns lower and upper enclosures of the integrals of this tube \([x](\cdot)=[x^-(\cdot),x^+(\cdot)]\) between \([t_1]\) and \([t_2]\), using precomputed partial primitives.
This method returns a pair obtained by subtracting the partial integral enclosures at t1 from those at t2. The returned pair \(([p^-],[p^+])\) is such that:
\[ [p^-]\supset \left\{\int_{\tau_1}^{\tau_2} x^-(s)\,ds \;\middle|\; \tau_1\in[t_1],\ \tau_2\in[t_2] \right\} \]
and
\[ [p^+]\supset \left\{\int_{\tau_1}^{\tau_2} x^+(s)\,ds \;\middle|\; \tau_1\in[t_1],\ \tau_2\in[t_2] \right\}. \]
| t1 | first temporal interval \([t_1]\) |
| t2 | second temporal interval \([t_2]\) |
| primitives | pair of tubes returned by partial_primitives() for this tube |
|
inline |
|
inline |
|
inline |
Returns the approximated midpoint trajectory of this tube.
| V | sampled value type |