codac 1.5.6
|
One dimensional tube \([x](\cdot)\), defined as an interval of scalar trajectories. More...
#include <codac_Tube.h>
Public Member Functions | |
Definition | |
Tube (const Interval &tdomain, const Interval &codomain=Interval::ALL_REALS) | |
Creates a scalar tube \([x](\cdot)\) made of one slice. | |
Tube (const Interval &tdomain, double timestep, const Interval &codomain=Interval::ALL_REALS) | |
Creates a scalar tube \([x](\cdot)\) with some temporal discretization. | |
Tube (const Interval &tdomain, double timestep, const TFnc &f, int f_image_id=0) | |
Creates a scalar tube \([x](\cdot)\) from a TFnc object and with some temporal discretization. | |
Tube (const std::vector< Interval > &v_tdomains, const std::vector< Interval > &v_codomains) | |
Creates a tube \([x](\cdot)\) from a list of \(k\) boxes \(\big([t_1]\times[x_1],\dots,[t_k]\times[x_k]\big)\). | |
Tube (const Tube &x) | |
Creates a copy of a scalar tube \([x](\cdot)\), with the same time discretization. | |
Tube (const Tube &x, const TFnc &f, int f_image_id=0) | |
Creates a copy of a scalar tube \([x](\cdot)\), with the same time discretization but a specific codomain defined by a TFnc object. | |
Tube (const Trajectory &traj, double timestep) | |
Creates a scalar tube \([x](\cdot)\) enclosing a trajectory \(x(\cdot)\), possibly with some temporal discretization. | |
Tube (const Trajectory &lb, const Trajectory &ub, double timestep) | |
Creates a scalar tube \([x](\cdot)\) defined as an interval of two trajectories \([lb(\cdot),ub(\cdot)]\). | |
Tube (const std::string &binary_file_name) | |
Restore a scalar tube from serialization. | |
Tube (const std::string &binary_file_name, Trajectory *&traj) | |
Restore a scalar tube from serialization, together with a Trajectory object. | |
~Tube () | |
Tube destructor. | |
int | size () const |
Returns the dimension of the scalar tube (always 1) | |
const Tube | primitive (const Interval &c=Interval(0.)) const |
Returns the primitive Tube of this tube. | |
const Tube & | operator= (const Tube &x) |
Returns a copy of a Tube. | |
const Interval | tdomain () const |
Returns the temporal definition domain of this tube. | |
const Polygon | polygon_envelope () const |
Returns the polygon envelope of this tube. | |
const Trajectory | lb () const |
Returns a possible lower bound \(x^{-}(\cdot)\) of the tube. | |
const Trajectory | ub () const |
Returns a possible upper bound \(x^{+}(\cdot)\) of the tube. | |
Slices structure | |
int | nb_slices () const |
Returns the number of slices of this tube. | |
Slice * | slice (int slice_id) |
Returns a pointer to the ith Slice object of this tube. | |
const Slice * | slice (int slice_id) const |
Returns a constant pointer to the ith Slice object of this tube. | |
Slice * | slice (double t) |
Returns a pointer to the Slice object of this tube that is defined at \(t\). | |
const Slice * | slice (double t) const |
Returns a constant pointer to the Slice object of this tube that is defined at \(t\). | |
Slice * | first_slice () |
Returns a pointer to the first Slice object of this tube. | |
const Slice * | first_slice () const |
Returns a constant pointer to the first Slice object of this tube. | |
Slice * | last_slice () |
Returns a pointer to the last Slice object of this tube. | |
const Slice * | last_slice () const |
Returns a constant pointer to the last Slice object of this tube. | |
Slice * | wider_slice () |
Returns a pointer to the Slice defined over the wider temporal domain. | |
const Slice * | wider_slice () const |
Returns a constant pointer to the Slice defined over the wider temporal domain. | |
Slice * | largest_slice () |
Returns a pointer to the Slice object of this tube for which the interval value is the most uncertain. | |
const Slice * | largest_slice () const |
Returns a constant pointer to the Slice object of this tube for which the interval value is the most uncertain. | |
Slice * | steepest_slice () |
Returns a pointer to the Slice object of this tube for which the difference between the mid values of the input and output gates is the largest. | |
const Slice * | steepest_slice () const |
Returns a const pointer to the Slice object of this tube for which the difference between the mid values of the input and output gates is the largest. | |
const Interval | slice_tdomain (int slice_id) const |
Returns the temporal definition domain of the ith Slice of this tube. | |
int | time_to_index (double t) const |
Returns the Slice index related to the temporal key \(t\). | |
int | index (const Slice *slice) const |
Returns the Slice index related to the Slice pointer. | |
void | sample (double t) |
Samples this tube at \(t\). | |
void | sample (double t, Slice *slice_to_be_sampled) |
Samples this tube at \(t\) from a pointer to the corresponding slice. | |
void | sample (double t, const Interval &gate) |
Samples this tube at \(t\) with a specific gate value. | |
void | sample (const Tube &x) |
Samples this tube so that it will share the same sampling of \([x](\cdot)\). | |
bool | gate_exists (double t) const |
Tests if a gate exists at time \(t\). | |
void | remove_gate (double t) |
Removes the gate at \(t\) and merges the two related slices. | |
void | merge_similar_slices (double distance_threshold) |
Merges all adjacent slices whose Hausdorff distance is less than the given threshold. | |
Accessing values | |
const Interval | codomain () const |
Returns the interval of feasible values. | |
double | volume () const |
Returns the volume of this tube. | |
const Interval | operator() (int slice_id) const |
Returns the value of the ith slice. | |
const Interval | operator() (double t) const |
Returns the evaluation of this tube at \(t\). | |
const Interval | operator() (const Interval &t) const |
Returns the interval evaluation of this tube over \([t]\). | |
const std::pair< Interval, Interval > | eval (const Interval &t=Interval::ALL_REALS) const |
Returns the interval evaluations of the bounds of the tube \(\underline{x^-}(\cdot)\) and \(\overline{x^+}(\cdot)\) over \([t]\). | |
const Interval | interpol (double t, const Tube &v) const |
Returns the optimal evaluation of this tube at \(t\), based on the derivative information \(\dot{x}(\cdot)\). | |
const Interval | interpol (const Interval &t, const Tube &v) const |
Returns the optimal interval evaluation of this tube over \([t]\), based on the derivative information \(\dot{x}(\cdot)\). | |
const Interval | invert (const Interval &y, const Interval &search_tdomain=Interval::ALL_REALS) const |
Returns the interval inversion \([x]^{-1}([y])\). | |
void | invert (const Interval &y, std::vector< Interval > &v_t, const Interval &search_tdomain=Interval::ALL_REALS) const |
Computes the set of continuous values of the inversion \([x]^{-1}([y])\). | |
const Interval | invert (const Interval &y, const Tube &v, const Interval &search_tdomain=Interval::ALL_REALS) const |
Returns the optimal interval inversion \([x]^{-1}([y])\). | |
void | invert (const Interval &y, std::vector< Interval > &v_t, const Tube &v, const Interval &search_tdomain=Interval::ALL_REALS) const |
Computes the set of continuous values of the optimal inversion \([x]^{-1}([y])\). | |
double | max_diam () const |
Returns the diameter of the interval value \([x](t)\) that is the more uncertain. | |
double | max_gate_diam (double &t) const |
Returns the diameter of the gate of this tube that is the more uncertain. | |
const Trajectory | diam (bool gates_thicknesses=false) const |
Returns the diameters of the tube as a trajectory. | |
const Trajectory | diam (const Tube &v) const |
Returns the diameters of the tube as a trajectory. | |
Tests | |
bool | operator== (const Tube &x) const |
Returns true if this tube is equal to \([x](\cdot)\). | |
bool | operator!= (const Tube &x) const |
Returns true if this tube is different from \([x](\cdot)\). | |
bool | is_subset (const Tube &x) const |
Returns true if this tube is a subset of \([x](\cdot)\). | |
bool | is_strict_subset (const Tube &x) const |
Returns true if this tube is a subset of \([x](\cdot)\), and not \([x](\cdot)\) itself. | |
bool | is_interior_subset (const Tube &x) const |
Returns true if this tube is a subset of the interior of \([x](\cdot)\). | |
bool | is_strict_interior_subset (const Tube &x) const |
Returns true if this tube is a subset of the interior of \([x](\cdot)\), and not \([x](\cdot)\) itself. | |
bool | is_superset (const Tube &x) const |
Returns true if this tube is a superset of \([x](\cdot)\). | |
bool | is_strict_superset (const Tube &x) const |
Returns true if this tube is a superset of \([x](\cdot)\), and not \([x](\cdot)\) itself. | |
bool | is_empty () const |
Returns true if this tube is empty. | |
const BoolInterval | contains (const Trajectory &x) const |
Returns true if this tube contains the trajectory \(x(\cdot)\). | |
bool | overlaps (const Tube &x, float ratio=1.) const |
Returns true if this tube overlaps the tube \([x](\cdot)\). | |
Setting values | |
const Tube & | set (const Interval &y) |
Sets a constant interval value for this tube: \(\forall t, [x](t)=[y]\). | |
const Tube & | set (const Interval &y, int slice_id) |
Sets the interval value of the ith slice of this tube. | |
const Tube & | set (const Interval &y, double t) |
Sets the interval value of this tube at \(t\): \([x](t)=[y]\). | |
const Tube & | set (const Interval &y, const Interval &t) |
Sets the interval value of this tube over \([t]\): \(\forall t\in[t], [x](t)=[y]\). | |
const Tube & | set_empty () |
Sets this tube to the empty set. | |
const Tube & | inflate (double rad) |
Inflates this tube by adding \([-rad,+rad]\) to all its codomain components. | |
const Tube & | inflate (const Trajectory &rad) |
Inflates this tube by adding non-constant uncertainties defined in a trajectory. | |
Tube & | truncate_tdomain (const Interval &tdomain) |
Truncates the tdomain of \([x](\cdot)\). | |
void | shift_tdomain (double a) |
Shifts the tdomain \([t_0,t_f]\) of \([x](\cdot)\). | |
Bisection | |
const std::pair< Tube, Tube > | bisect (double t, float ratio=0.49) const |
Bisects this tube. | |
Assignments operators | |
const Tube & | operator+= (const Interval &x) |
Operates +=. | |
const Tube & | operator+= (const Trajectory &x) |
Operates +=. | |
const Tube & | operator+= (const Tube &x) |
Operates +=. | |
const Tube & | operator-= (const Interval &x) |
Operates -=. | |
const Tube & | operator-= (const Trajectory &x) |
Operates -=. | |
const Tube & | operator-= (const Tube &x) |
Operates -=. | |
const Tube & | operator*= (const Interval &x) |
Operates *=. | |
const Tube & | operator*= (const Trajectory &x) |
Operates *=. | |
const Tube & | operator*= (const Tube &x) |
Operates *=. | |
const Tube & | operator/= (const Interval &x) |
Operates /=. | |
const Tube & | operator/= (const Trajectory &x) |
Operates /=. | |
const Tube & | operator/= (const Tube &x) |
Operates /=. | |
const Tube & | operator|= (const Interval &x) |
Operates |=. | |
const Tube & | operator|= (const Trajectory &x) |
Operates |=. | |
const Tube & | operator|= (const Tube &x) |
Operates |=. | |
const Tube & | operator&= (const Interval &x) |
Operates &=. | |
const Tube & | operator&= (const Trajectory &x) |
Operates &=. | |
const Tube & | operator&= (const Tube &x) |
Operates &=. | |
Integration | |
const Interval | integral (double t) const |
Computes the interval integral \(\int_0^t[x](\tau)d\tau\). | |
const Interval | integral (const Interval &t) const |
Computes the interval integral \(\int_0^{[t]}[x](\tau)d\tau\). | |
const Interval | integral (const Interval &t1, const Interval &t2) const |
Computes the interval integral \(\int_{[t_1]}^{[t_2]}[x](\tau)d\tau\). | |
const std::pair< Interval, Interval > | partial_integral (const Interval &t) const |
Computes the partial interval integral \(\int_{0}^{[t]}[x](\tau)d\tau\). | |
const std::pair< Interval, Interval > | partial_integral (const Interval &t1, const Interval &t2) const |
Computes the partial interval integral \(\int_{[t_1]}^{[t_2]}[x](\tau)d\tau\). | |
Serialization | |
void | serialize (const std::string &binary_file_name="x.tube", int version_number=SERIALIZATION_VERSION) const |
Serializes this tube. | |
void | serialize (const std::string &binary_file_name, const Trajectory &traj, int version_number=SERIALIZATION_VERSION) const |
Serializes this tube together with a Trajectory object. | |
Public Member Functions inherited from codac::DynamicalItem | |
virtual | ~DynamicalItem () |
DynamicalItem destructor. | |
Static Public Member Functions | |
static bool | same_slicing (const Tube &x1, const Tube &x2) |
Tests whether the two Tube objects are sharing the same slicing. | |
static void | enable_syntheses (bool enable=true) |
Enables the computation of a synthesis tree for any Tube object. | |
static const Tube | hull (const std::list< Tube > &l_tubes) |
Computes the hull of several tubes. | |
Static Public Member Functions inherited from codac::DynamicalItem | |
static bool | valid_tdomain (const Interval &tdomain) |
Verifies that this interval is a feasible tdomain. | |
Protected Member Functions | |
Tube () | |
Creates a not-defined scalar tube. | |
const IntervalVector | codomain_box () const |
Returns the box \([x]([t_0,t_f])\). | |
void | deserialize (const std::string &binary_file_name, Trajectory *&traj) |
Restores a scalar tube from serialization, together with a Trajectory object. | |
void | create_synthesis_tree () const |
Creates the synthesis tree associated to the values of this tube. | |
void | delete_synthesis_tree () const |
Deletes the synthesis tree of this tube. | |
void | create_polynomial_synthesis (double eps) const |
Creates the synthesis tree associated to the values of this tube. | |
void | delete_polynomial_synthesis () const |
Deletes the synthesis tree of this tube. | |
Protected Attributes | |
Slice * | m_first_slice = nullptr |
pointer to the first Slice object of this tube | |
TubeTreeSynthesis * | m_synthesis_tree = nullptr |
pointer to the optional synthesis tree | |
TubePolynomialSynthesis * | m_polynomial_synthesis = nullptr |
pointer to the optional synthesis tree | |
SynthesisMode | m_synthesis_mode = SynthesisMode::NONE |
enables of the use of a synthesis tree | |
Interval | m_tdomain |
redundant information for fast evaluations | |
String | |
const std::string | class_name () const |
Returns the name of this class. | |
void | enable_synthesis (SynthesisMode mode=SynthesisMode::BINARY_TREE, double eps=1.e-3) const |
Enables the computation of a synthesis tree. | |
One dimensional tube \([x](\cdot)\), defined as an interval of scalar trajectories.
|
explicit |
Creates a scalar tube \([x](\cdot)\) made of one slice.
tdomain | temporal domain \([t_0,t_f]\) |
codomain | Interval value of the slice (all reals \([-\infty,\infty]\) by default) |
|
explicit |
Creates a scalar tube \([x](\cdot)\) with some temporal discretization.
tdomain | temporal domain \([t_0,t_f]\) |
timestep | sampling value \(\delta\) for the temporal discretization (double) |
codomain | Interval value of the slices (all reals \([-\infty,\infty]\) by default) |
|
explicit |
Creates a scalar tube \([x](\cdot)\) from a TFnc object and with some temporal discretization.
tdomain | temporal domain \([t_0,t_f]\) |
timestep | sampling value \(\delta\) for the temporal discretization (double) |
f | TFnc object that will be enclosed by the tube: \(\forall t\in[t_0,t_f], [f](t)\subseteq[x](t)\) |
f_image_id | component index of the interval function \([f]\) (that is possibly multidimensional, first component by default) |
|
explicit |
Creates a tube \([x](\cdot)\) from a list of \(k\) boxes \(\big([t_1]\times[x_1],\dots,[t_k]\times[x_k]\big)\).
v_tdomains | vector of temporal domains \([t_i]\) |
v_codomains | vector of codomains \([x_i]\) related to the \([t_i]\)'s |
codac::Tube::Tube | ( | const Tube & | x | ) |
Creates a copy of a scalar tube \([x](\cdot)\), with the same time discretization.
x | Tube to be duplicated |
|
explicit |
Creates a copy of a scalar tube \([x](\cdot)\), with the same time discretization but a specific codomain defined by a TFnc object.
x | Tube from which the sampling will be duplicated |
f | TFnc object that will be enclosed by the tube: \(\forall t\in[t_0,t_f], [f](t)\subseteq[x](t)\) |
f_image_id | component index of the interval function \([f]\) (that is possibly multidimensional, first component by default) |
|
explicit |
Creates a scalar tube \([x](\cdot)\) enclosing a trajectory \(x(\cdot)\), possibly with some temporal discretization.
traj | Trajectory \(x(\cdot)\) to enclose |
timestep | sampling value \(\delta\) for the temporal discretization (double, no discretization by default: one slice only) |
|
explicit |
Creates a scalar tube \([x](\cdot)\) defined as an interval of two trajectories \([lb(\cdot),ub(\cdot)]\).
lb | Trajectory defining the lower bound \(x^{-}(\cdot)\) of the tube |
ub | Trajectory defining the upper bound \(x^{+}(\cdot)\) of the tube |
timestep | sampling value \(\delta\) for the temporal discretization (double, no discretization by default: one slice only) |
|
explicit |
Restore a scalar tube from serialization.
binary_file_name | path to the binary file |
|
explicit |
Restore a scalar tube from serialization, together with a Trajectory object.
binary_file_name | path to the binary file |
traj | a pointer to the Trajectory object to be instantiated |
|
protected |
Creates a not-defined scalar tube.
|
virtual |
const Tube codac::Tube::primitive | ( | const Interval & | c = Interval(0.) | ) | const |
|
virtual |
Returns the temporal definition domain of this tube.
Implements codac::DynamicalItem.
const Polygon codac::Tube::polygon_envelope | ( | ) | const |
Returns the polygon envelope of this tube.
const Trajectory codac::Tube::lb | ( | ) | const |
Returns a possible lower bound \(x^{-}(\cdot)\) of the tube.
const Trajectory codac::Tube::ub | ( | ) | const |
Returns a possible upper bound \(x^{+}(\cdot)\) of the tube.
int codac::Tube::nb_slices | ( | ) | const |
Returns the number of slices of this tube.
Slice * codac::Tube::slice | ( | int | slice_id | ) |
const Slice * codac::Tube::slice | ( | int | slice_id | ) | const |
Slice * codac::Tube::slice | ( | double | t | ) |
const Slice * codac::Tube::slice | ( | double | t | ) | const |
Returns a constant pointer to the Slice object of this tube that is defined at \(t\).
t | the temporal key (double, must belong to the Tube's tdomain) |
Slice * codac::Tube::first_slice | ( | ) |
const Slice * codac::Tube::first_slice | ( | ) | const |
Slice * codac::Tube::last_slice | ( | ) |
const Slice * codac::Tube::last_slice | ( | ) | const |
Slice * codac::Tube::wider_slice | ( | ) |
const Slice * codac::Tube::wider_slice | ( | ) | const |
Slice * codac::Tube::largest_slice | ( | ) |
const Slice * codac::Tube::largest_slice | ( | ) | const |
Slice * codac::Tube::steepest_slice | ( | ) |
const Slice * codac::Tube::steepest_slice | ( | ) | const |
const Interval codac::Tube::slice_tdomain | ( | int | slice_id | ) | const |
int codac::Tube::time_to_index | ( | double | t | ) | const |
int codac::Tube::index | ( | const Slice * | slice | ) | const |
void codac::Tube::sample | ( | double | t | ) |
void codac::Tube::sample | ( | double | t, |
Slice * | slice_to_be_sampled ) |
void codac::Tube::sample | ( | double | t, |
const Interval & | gate ) |
void codac::Tube::sample | ( | const Tube & | x | ) |
Samples this tube so that it will share the same sampling of \([x](\cdot)\).
x | the Tube from which the new sampling will come from |
bool codac::Tube::gate_exists | ( | double | t | ) | const |
Tests if a gate exists at time \(t\).
t | time input to test |
true
if a gate exists void codac::Tube::remove_gate | ( | double | t | ) |
Removes the gate at \(t\) and merges the two related slices.
t | time input where the gate to remove is |
void codac::Tube::merge_similar_slices | ( | double | distance_threshold | ) |
Merges all adjacent slices whose Hausdorff distance is less than the given threshold.
distance_threshold | the threshold for the maximum Haussdorf distance between adjacent slices |
const Interval codac::Tube::codomain | ( | ) | const |
Returns the interval of feasible values.
double codac::Tube::volume | ( | ) | const |
Returns the volume of this tube.
const Interval codac::Tube::operator() | ( | int | slice_id | ) | const |
Returns the value of the ith slice.
slice_id | the index of the ith slice |
const Interval codac::Tube::operator() | ( | double | t | ) | const |
Returns the evaluation of this tube at \(t\).
t | the temporal key (double, must belong to the Tube's tdomain) |
const Interval codac::Tube::operator() | ( | const Interval & | t | ) | const |
Returns the interval evaluation of this tube over \([t]\).
t | the subtdomain (Interval, must be a subset of the Tube's tdomain) |
const std::pair< Interval, Interval > codac::Tube::eval | ( | const Interval & | t = Interval::ALL_REALS | ) | const |
Returns the interval evaluations of the bounds of the tube \(\underline{x^-}(\cdot)\) and \(\overline{x^+}(\cdot)\) over \([t]\).
t | the subtdomain (Interval, must be a subset of the Tube's tdomain) |
const Interval codac::Tube::interpol | ( | double | t, |
const Tube & | v ) const |
Returns the optimal evaluation of this tube at \(t\), based on the derivative information \(\dot{x}(\cdot)\).
t | the temporal key (double, must belong to the Tube's tdomain) |
v | the derivative tube such that \(\dot{x}(\cdot)\in[v](\cdot)\) |
const Interval codac::Tube::interpol | ( | const Interval & | t, |
const Tube & | v ) const |
Returns the optimal interval evaluation of this tube over \([t]\), based on the derivative information \(\dot{x}(\cdot)\).
t | the subtdomain (Interval, must be a subset of the Tube's tdomain) |
v | the derivative tube such that \(\dot{x}(\cdot)\in[v](\cdot)\) |
const Interval codac::Tube::invert | ( | const Interval & | y, |
const Interval & | search_tdomain = Interval::ALL_REALS ) const |
Returns the interval inversion \([x]^{-1}([y])\).
y | the interval codomain |
search_tdomain | the optional temporal domain on which the inversion will be performed |
void codac::Tube::invert | ( | const Interval & | y, |
std::vector< Interval > & | v_t, | ||
const Interval & | search_tdomain = Interval::ALL_REALS ) const |
Computes the set of continuous values of the inversion \([x]^{-1}([y])\).
y | the interval codomain |
v_t | the vector of the sub-tdomains \([t_k]\) for which \(\forall t\in[t_k] \mid x(t)\in[y], x(\cdot)\in[x](\cdot)\) |
search_tdomain | the optional temporal domain on which the inversion will be performed |
const Interval codac::Tube::invert | ( | const Interval & | y, |
const Tube & | v, | ||
const Interval & | search_tdomain = Interval::ALL_REALS ) const |
Returns the optimal interval inversion \([x]^{-1}([y])\).
y | the interval codomain |
v | the derivative tube such that \(\dot{x}(\cdot)\in[v](\cdot)\) |
search_tdomain | the optional temporal domain on which the inversion will be performed |
void codac::Tube::invert | ( | const Interval & | y, |
std::vector< Interval > & | v_t, | ||
const Tube & | v, | ||
const Interval & | search_tdomain = Interval::ALL_REALS ) const |
Computes the set of continuous values of the optimal inversion \([x]^{-1}([y])\).
y | the interval codomain |
v_t | the vector of the sub-tdomains \([t_k]\) for which \(\exists t\in[t_k] \mid x(t)\in[y], x(\cdot)\in[x](\cdot), \dot{x}(\cdot)\in[v](\cdot)\) |
v | the derivative tube such that \(\dot{x}(\cdot)\in[v](\cdot)\) |
search_tdomain | the optional temporal domain on which the inversion will be performed |
double codac::Tube::max_diam | ( | ) | const |
Returns the diameter of the interval value \([x](t)\) that is the more uncertain.
double codac::Tube::max_gate_diam | ( | double & | t | ) | const |
Returns the diameter of the gate of this tube that is the more uncertain.
t | the temporal key of the corresponding uncertain gate |
const Trajectory codac::Tube::diam | ( | bool | gates_thicknesses = false | ) | const |
Returns the diameters of the tube as a trajectory.
gates_thicknesses | if true, the diameters of the gates will be evaluated too |
const Trajectory codac::Tube::diam | ( | const Tube & | v | ) | const |
Returns the diameters of the tube as a trajectory.
v | the derivative tube such that \(\dot{x}(\cdot)\in[v](\cdot)\) |
bool codac::Tube::operator== | ( | const Tube & | x | ) | const |
Returns true if this tube is equal to \([x](\cdot)\).
x | the Tube object |
bool codac::Tube::operator!= | ( | const Tube & | x | ) | const |
Returns true if this tube is different from \([x](\cdot)\).
x | the Tube object |
bool codac::Tube::is_subset | ( | const Tube & | x | ) | const |
Returns true if this tube is a subset of \([x](\cdot)\).
x | the Tube object |
bool codac::Tube::is_strict_subset | ( | const Tube & | x | ) | const |
Returns true if this tube is a subset of \([x](\cdot)\), and not \([x](\cdot)\) itself.
x | the Tube object |
bool codac::Tube::is_interior_subset | ( | const Tube & | x | ) | const |
Returns true if this tube is a subset of the interior of \([x](\cdot)\).
x | the Tube object |
bool codac::Tube::is_strict_interior_subset | ( | const Tube & | x | ) | const |
Returns true if this tube is a subset of the interior of \([x](\cdot)\), and not \([x](\cdot)\) itself.
x | the Tube object |
bool codac::Tube::is_superset | ( | const Tube & | x | ) | const |
Returns true if this tube is a superset of \([x](\cdot)\).
x | the Tube object |
bool codac::Tube::is_strict_superset | ( | const Tube & | x | ) | const |
Returns true if this tube is a superset of \([x](\cdot)\), and not \([x](\cdot)\) itself.
x | the Tube object |
bool codac::Tube::is_empty | ( | ) | const |
Returns true if this tube is empty.
const BoolInterval codac::Tube::contains | ( | const Trajectory & | x | ) | const |
Returns true if this tube contains the trajectory \(x(\cdot)\).
x | the trajectory that might be contained by this tube |
bool codac::Tube::overlaps | ( | const Tube & | x, |
float | ratio = 1. ) const |
Returns true if this tube overlaps the tube \([x](\cdot)\).
x | the other tube |
ratio | an optional overlapping ratio between 0 and 1 (1 by default). For instance, if ratio=0.3 and there is an overlapping of at least 30%, then the function returns true |
const Tube & codac::Tube::set | ( | const Interval & | y | ) |
Sets a constant interval value for this tube: \(\forall t, [x](t)=[y]\).
y | Interval value of the slices |
const Tube & codac::Tube::set | ( | const Interval & | y, |
int | slice_id ) |
Sets the interval value of the ith slice of this tube.
y | Interval value of the ith slice |
slice_id | index of the ith Slice |
const Tube & codac::Tube::set | ( | const Interval & | y, |
double | t ) |
Sets the interval value of this tube at \(t\): \([x](t)=[y]\).
y | Interval value of the gate |
t | the temporal key (double, must belong to the Tube's tdomain) |
const Tube & codac::Tube::set | ( | const Interval & | y, |
const Interval & | t ) |
Sets the interval value of this tube over \([t]\): \(\forall t\in[t], [x](t)=[y]\).
y | Interval value to be set |
t | the subtdomain (Interval, must be a subset of the Tube's tdomain) |
const Tube & codac::Tube::set_empty | ( | ) |
Sets this tube to the empty set.
const Tube & codac::Tube::inflate | ( | double | rad | ) |
Inflates this tube by adding \([-rad,+rad]\) to all its codomain components.
rad | half of the inflation |
const Tube & codac::Tube::inflate | ( | const Trajectory & | rad | ) |
Inflates this tube by adding non-constant uncertainties defined in a trajectory.
rad | the Trajectory object defining the non-constant inflation |
Tube & codac::Tube::truncate_tdomain | ( | const Interval & | tdomain | ) |
Truncates the tdomain of \([x](\cdot)\).
tdomain | new temporal domain \([t_0,t_f]\) |
void codac::Tube::shift_tdomain | ( | double | a | ) |
Shifts the tdomain \([t_0,t_f]\) of \([x](\cdot)\).
a | the offset value so that \([t_0,t_f]:=[t_0+a,t_f+a]\) |
Bisects this tube.
t | the temporal key (double, must belong to the Tube's tdomain) |
ratio | the bisection ratio (default value: 0.55) |
const Tube & codac::Tube::operator+= | ( | const Interval & | x | ) |
Operates +=.
x | Interval |
const Tube & codac::Tube::operator+= | ( | const Trajectory & | x | ) |
const Tube & codac::Tube::operator-= | ( | const Interval & | x | ) |
Operates -=.
x | Interval |
const Tube & codac::Tube::operator-= | ( | const Trajectory & | x | ) |
const Tube & codac::Tube::operator*= | ( | const Interval & | x | ) |
Operates *=.
x | Interval |
const Tube & codac::Tube::operator*= | ( | const Trajectory & | x | ) |
const Tube & codac::Tube::operator/= | ( | const Interval & | x | ) |
Operates /=.
x | Interval |
const Tube & codac::Tube::operator/= | ( | const Trajectory & | x | ) |
const Tube & codac::Tube::operator|= | ( | const Interval & | x | ) |
Operates |=.
x | Interval |
const Tube & codac::Tube::operator|= | ( | const Trajectory & | x | ) |
const Tube & codac::Tube::operator&= | ( | const Interval & | x | ) |
Operates &=.
x | Interval |
const Tube & codac::Tube::operator&= | ( | const Trajectory & | x | ) |
|
inlinevirtual |
Returns the name of this class.
Implements codac::DynamicalItem.
void codac::Tube::enable_synthesis | ( | SynthesisMode | mode = SynthesisMode::BINARY_TREE, |
double | eps = 1.e-3 ) const |
Enables the computation of a synthesis tree.
mode | mode of synthesis |
eps | precision of the polynomial approximation, if selected |
const Interval codac::Tube::integral | ( | double | t | ) | const |
Computes the interval integral \(\int_0^t[x](\tau)d\tau\).
t | the temporal key (double, must belong to the Tube's tdomain) |
const Interval codac::Tube::integral | ( | const Interval & | t | ) | const |
Computes the interval integral \(\int_0^{[t]}[x](\tau)d\tau\).
t | the subtdomain (Interval, must be a subset of the Tube's tdomain) |
const Interval codac::Tube::integral | ( | const Interval & | t1, |
const Interval & | t2 ) const |
Computes the interval integral \(\int_{[t_1]}^{[t_2]}[x](\tau)d\tau\).
const std::pair< Interval, Interval > codac::Tube::partial_integral | ( | const Interval & | t | ) | const |
Computes the partial interval integral \(\int_{0}^{[t]}[x](\tau)d\tau\).
t | interval upper bound, subset of the Tube's tdomain |
const std::pair< Interval, Interval > codac::Tube::partial_integral | ( | const Interval & | t1, |
const Interval & | t2 ) const |
Computes the partial interval integral \(\int_{[t_1]}^{[t_2]}[x](\tau)d\tau\).
t1 | interval lower bound, subset of the Tube's tdomain |
t2 | interval upper bound, subset of the Tube's tdomain |
void codac::Tube::serialize | ( | const std::string & | binary_file_name = "x.tube", |
int | version_number = SERIALIZATION_VERSION ) const |
Serializes this tube.
binary_file_name | name of the output file (default value: "x.tube") |
version_number | serialization version (used for tests purposes, default value: last version) |
void codac::Tube::serialize | ( | const std::string & | binary_file_name, |
const Trajectory & | traj, | ||
int | version_number = SERIALIZATION_VERSION ) const |
Serializes this tube together with a Trajectory object.
binary_file_name | name of the output file (default value: "x.tube") |
traj | the Trajectory object to serialize (for instance, actual but unknown values) |
version_number | serialization version (used for tests purposes, default value: last version) |
|
static |
Enables the computation of a synthesis tree for any Tube object.
enable | boolean |
Computes the hull of several tubes.
l_tubes | list of tubes |
|
protectedvirtual |
Returns the box \([x]([t_0,t_f])\).
Implements codac::DynamicalItem.
|
protected |
Restores a scalar tube from serialization, together with a Trajectory object.
binary_file_name | path to the binary file |
traj | a pointer to the Trajectory object to be instantiated |
|
protected |
Creates the synthesis tree associated to the values of this tube.
|
protected |
Creates the synthesis tree associated to the values of this tube.
eps | precision of the polynomial approximation |