12 #ifndef __CODAC_TUBE_H__ 13 #define __CODAC_TUBE_H__ 18 #include "codac_TFnc.h" 23 #include "codac_TubeTreeSynthesis.h" 24 #include "codac_TubePolynomialSynthesis.h" 25 #include "codac_TubeSynthesis.h" 26 #include "codac_Polygon.h" 38 class TubeTreeSynthesis;
39 class TubePolynomialSynthesis;
69 explicit Tube(
const Interval& tdomain,
double timestep,
const Interval&
codomain = Interval::ALL_REALS);
84 explicit Tube(
const Interval& tdomain,
double timestep,
const TFnc& f,
int f_image_id = 0);
95 explicit Tube(
const std::vector<Interval>& v_tdomains,
const std::vector<Interval>& v_codomains);
117 explicit Tube(
const Tube& x,
const TFnc& f,
int f_image_id = 0);
153 explicit Tube(
const std::string& binary_file_name);
164 explicit Tube(
const std::string& binary_file_name,
Trajectory *&traj);
184 const Tube primitive(
const Interval& c = Interval(0.))
const;
199 const Interval
tdomain()
const;
415 void sample(
double t,
const Interval& gate);
477 const Interval
operator()(
int slice_id)
const;
493 const Interval
operator()(
const Interval& t)
const;
502 const std::pair<Interval,Interval>
eval(
const Interval& t = Interval::ALL_REALS)
const;
526 const Interval
interpol(
const Interval& t,
const Tube& v)
const;
537 const Interval
invert(
const Interval& y,
const Interval& search_tdomain = Interval::ALL_REALS)
const;
547 void invert(
const Interval& y, std::vector<Interval> &v_t,
const Interval& search_tdomain = Interval::ALL_REALS)
const;
560 const Interval
invert(
const Interval& y,
const Tube& v,
const Interval& search_tdomain = Interval::ALL_REALS)
const;
573 void invert(
const Interval& y, std::vector<Interval> &v_t,
const Tube& v,
const Interval& search_tdomain = Interval::ALL_REALS)
const;
756 const Tube&
set(
const Interval& y);
765 const Tube&
set(
const Interval& y,
int slice_id);
778 const Tube&
set(
const Interval& y,
double t);
791 const Tube&
set(
const Interval& y,
const Interval& t);
855 const std::pair<Tube,Tube>
bisect(
double t,
float ratio = 0.49)
const;
1025 friend std::ostream&
operator<<(std::ostream& str,
const Tube& x);
1037 void enable_synthesis(SynthesisMode mode = SynthesisMode::BINARY_TREE,
double eps = 1.e-3)
const;
1052 const Interval
integral(
double t)
const;
1063 const Interval
integral(
const Interval& t)
const;
1075 const Interval
integral(
const Interval& t1,
const Interval& t2)
const;
1088 const std::pair<Interval,Interval>
partial_integral(
const Interval& t)
const;
1102 const std::pair<Interval,Interval>
partial_integral(
const Interval& t1,
const Interval& t2)
const;
1116 void serialize(
const std::string& binary_file_name =
"x.tube",
int version_number = SERIALIZATION_VERSION)
const;
1129 void serialize(
const std::string& binary_file_name,
const Trajectory& traj,
int version_number = SERIALIZATION_VERSION)
const;
1161 static const Tube hull(
const std::list<Tube>& l_tubes);
1231 static bool s_enable_syntheses;
double volume() const
Returns the volume of this tube.
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9
Slice * last_slice()
Returns a pointer to the last Slice object of this tube.
void merge_similar_slices(double distance_threshold)
Merges all adjacent slices whose Hausdorff distance is less than the given threshold.
friend std::ostream & operator<<(std::ostream &str, const Tube &x)
Displays a synthesis of this tube.
const Interval integral(double t) const
Computes the interval integral .
const Tube & operator|=(const Interval &x)
Operates |=.
bool is_subset(const Tube &x) const
Returns true if this tube is a subset of .
Tube & truncate_tdomain(const Interval &tdomain)
Truncates the tdomain of .
bool is_strict_superset(const Tube &x) const
Returns true if this tube is a superset of , and not itself.
const Tube primitive(const Interval &c=Interval(0.)) const
Returns the primitive Tube of this tube.
void delete_polynomial_synthesis() const
Deletes the synthesis tree of this tube.
void create_synthesis_tree() const
Creates the synthesis tree associated to the values of this tube.
TubePolynomialSynthesis * m_polynomial_synthesis
pointer to the optional synthesis tree
Definition: codac_Tube.h:1222
int size() const
Returns the dimension of the scalar tube (always 1)
bool is_empty() const
Returns true if this tube is empty.
Slice of a one dimensional tube and made of an envelope and two gates.
Definition: codac_Slice.h:33
const Interval codomain() const
Returns the interval of feasible values.
const std::string class_name() const
Returns the name of this class.
Definition: codac_Tube.h:1016
bool gate_exists(double t) const
Tests if a gate exists at time .
const Trajectory ub() const
Returns a possible upper bound of the tube.
SynthesisMode m_synthesis_mode
enables of the use of a synthesis tree
Definition: codac_Tube.h:1223
One dimensional trajectory , defined as a temporal map of values.
Definition: codac_Trajectory.h:34
void shift_tdomain(double a)
Shifts the tdomain of .
Slice * m_first_slice
pointer to the first Slice object of this tube
Definition: codac_Tube.h:1220
int index(const Slice *slice) const
Returns the Slice index related to the Slice pointer.
TubeTreeSynthesis * m_synthesis_tree
pointer to the optional synthesis tree
Definition: codac_Tube.h:1221
static void enable_syntheses(bool enable=true)
Enables the computation of a synthesis tree for any Tube object.
Tube()
Creates a not-defined scalar tube.
const std::pair< Tube, Tube > bisect(double t, float ratio=0.49) const
Bisects this tube.
Abstract class for common properties of Tube, TubeVector, Slice, Trajectory, TrajectoryVector objects...
Definition: codac_DynamicalItem.h:25
void deserialize(const std::string &binary_file_name, Trajectory *&traj)
Restores a scalar tube from serialization, together with a Trajectory object.
friend void deserialize_Tube(std::ifstream &bin_file, Tube *&tube)
Creates a Tube object from a binary file.
bool is_strict_interior_subset(const Tube &x) const
Returns true if this tube is a subset of the interior of , and not itself.
double max_gate_diam(double &t) const
Returns the diameter of the gate of this tube that is the more uncertain.
const std::pair< Interval, Interval > partial_integral(const Interval &t) const
Computes the partial interval integral .
Interval m_tdomain
redundant information for fast evaluations
Definition: codac_Tube.h:1224
const IntervalVector codomain_box() const
Returns the box .
that contracts a tube with respect to its derivative tube and a measurement according to the cons...
Definition: codac_CtcEval.h:26
n-dimensional tube , defined as an interval of n-dimensional trajectories
Definition: codac_TubeVector.h:38
void enable_synthesis(SynthesisMode mode=SynthesisMode::BINARY_TREE, double eps=1.e-3) const
Enables the computation of a synthesis tree.
friend void deserialize_TubeVector(std::ifstream &bin_file, TubeVector *&tube)
Creates a TubeVector object from a binary file.
Slice * slice(int slice_id)
Returns a pointer to the ith Slice object of this tube.
One dimensional tube , defined as an interval of scalar trajectories.
Definition: codac_Tube.h:47
void create_polynomial_synthesis(double eps) const
Creates the synthesis tree associated to the values of this tube.
const Tube & operator/=(const Interval &x)
Operates /=.
bool is_strict_subset(const Tube &x) const
Returns true if this tube is a subset of , and not itself.
void sample(double t)
Samples this tube at .
const Trajectory diam(bool gates_thicknesses=false) const
Returns the diameters of the tube as a trajectory.
Slice * wider_slice()
Returns a pointer to the Slice defined over the wider temporal domain.
bool operator==(const Tube &x) const
Returns true if this tube is equal to .
bool is_interior_subset(const Tube &x) const
Returns true if this tube is a subset of the interior of .
const Polygon polygon_envelope() const
Returns the polygon envelope of this tube.
const Interval tdomain() const
Returns the temporal definition domain of this tube.
void remove_gate(double t)
Removes the gate at and merges the two related slices.
int time_to_index(double t) const
Returns the Slice index related to the temporal key .
const BoolInterval contains(const Trajectory &x) const
Returns true if this tube contains the trajectory .
static const Tube hull(const std::list< Tube > &l_tubes)
Computes the hull of several tubes.
void delete_synthesis_tree() const
Deletes the synthesis tree of this tube.
const Interval slice_tdomain(int slice_id) const
Returns the temporal definition domain of the ith Slice of this tube.
Slice * first_slice()
Returns a pointer to the first Slice object of this tube.
double max_diam() const
Returns the diameter of the interval value that is the more uncertain.
const Trajectory lb() const
Returns a possible lower bound of the tube.
const Tube & operator &=(const Interval &x)
Operates &=.
Slice * steepest_slice()
Returns a pointer to the Slice object of this tube for which the difference between the mid values of...
const std::pair< Interval, Interval > eval(const Interval &t=Interval::ALL_REALS) const
Returns the interval evaluations of the bounds of the tube and over .
const Interval operator()(int slice_id) const
Returns the value of the ith slice.
bool overlaps(const Tube &x, float ratio=1.) const
Returns true if this tube overlaps the tube .
const Tube & operator*=(const Interval &x)
Operates *=.
static bool same_slicing(const Tube &x1, const Tube &x2)
Tests whether the two Tube objects are sharing the same slicing.
const Tube & inflate(double rad)
Inflates this tube by adding to all its codomain components.
const Interval interpol(double t, const Tube &v) const
Returns the optimal evaluation of this tube at , based on the derivative information ...
bool operator!=(const Tube &x) const
Returns true if this tube is different from .
const Interval invert(const Interval &y, const Interval &search_tdomain=Interval::ALL_REALS) const
Returns the interval inversion .
bool is_superset(const Tube &x) const
Returns true if this tube is a superset of .
const Tube & operator=(const Tube &x)
Returns a copy of a Tube.
Slice * largest_slice()
Returns a pointer to the Slice object of this tube for which the interval value is the most uncertain...
void serialize(const std::string &binary_file_name="x.tube", int version_number=SERIALIZATION_VERSION) const
Serializes this tube.
const Tube & operator+=(const Interval &x)
Operates +=.
const Tube & operator-=(const Interval &x)
Operates -=.
const Tube & set_empty()
Sets this tube to the empty set.
int nb_slices() const
Returns the number of slices of this tube.