12 #ifndef __CODAC_TUBEVECTOR_H__ 13 #define __CODAC_TUBEVECTOR_H__ 18 #include <initializer_list> 19 #include "codac_TFnc.h" 24 #include "codac_TubeSynthesis.h" 70 explicit TubeVector(
const Interval& tdomain,
double timestep,
int n);
79 explicit TubeVector(
const Interval& tdomain,
double timestep,
const IntervalVector& codomain);
94 explicit TubeVector(
const Interval& tdomain,
double timestep,
const TFnc& f);
105 explicit TubeVector(
const std::vector<Interval>& v_tdomains,
const std::vector<IntervalVector>& v_codomains);
172 explicit TubeVector(
const std::string& binary_file_name);
252 const Interval
tdomain()
const;
312 void sample(
double t,
const IntervalVector& gate);
343 const IntervalVector
codomain()
const;
377 const IntervalVector
operator()(
int slice_id)
const;
385 const IntervalVector
operator()(
double t)
const;
393 const IntervalVector
operator()(
const Interval& t)
const;
402 const std::pair<IntervalVector,IntervalVector>
eval(
const Interval& t = Interval::ALL_REALS)
const;
437 const Interval
invert(
const IntervalVector& y,
const Interval& search_tdomain = Interval::ALL_REALS)
const;
447 void invert(
const IntervalVector& y, std::vector<Interval> &v_t,
const Interval& search_tdomain = Interval::ALL_REALS)
const;
460 const Interval
invert(
const IntervalVector& y,
const TubeVector& v,
const Interval& search_tdomain = Interval::ALL_REALS)
const;
473 void invert(
const IntervalVector& y, std::vector<Interval> &v_t,
const TubeVector& v,
const Interval& search_tdomain = Interval::ALL_REALS)
const;
545 const Trajectory diag(
int start_index,
int end_index,
bool gates_diag =
false)
const;
689 const TubeVector&
set(
const IntervalVector& y);
698 const TubeVector&
set(
const IntervalVector& y,
int slice_id);
711 const TubeVector&
set(
const IntervalVector& y,
double t);
724 const TubeVector&
set(
const IntervalVector& y,
const Interval& t);
798 const std::pair<TubeVector,TubeVector>
bisect(
double t,
float ratio = 0.49)
const;
812 const std::pair<TubeVector,TubeVector>
bisect(
double t,
int dim,
float ratio = 0.49)
const;
1044 void enable_synthesis(SynthesisMode mode = SynthesisMode::BINARY_TREE,
double eps = 1.e-3)
const;
1059 const IntervalVector
integral(
double t)
const;
1070 const IntervalVector
integral(
const Interval& t)
const;
1082 const IntervalVector
integral(
const Interval& t1,
const Interval& t2)
const;
1095 const std::pair<IntervalVector,IntervalVector>
partial_integral(
const Interval& t)
const;
1109 const std::pair<IntervalVector,IntervalVector>
partial_integral(
const Interval& t1,
const Interval& t2)
const;
1123 void serialize(
const std::string& binary_file_name =
"x.tube",
int version_number = SERIALIZATION_VERSION)
const;
1136 void serialize(
const std::string& binary_file_name,
const TrajectoryVector& traj,
int version_number = SERIALIZATION_VERSION)
const;
1170 static const TubeVector hull(
const std::list<TubeVector>& l_tubes);
bool is_interior_subset(const TubeVector &x) const
Returns true if this tube is a subset of the interior of .
const Trajectory diag(bool gates_diag=false) const
Returns the slices diagonals of the tube as a trajectory.
bool is_strict_interior_subset(const TubeVector &x) const
Returns true if this tube is a subset of the interior of , and not itself.
TubeVector()
Creates an undefined n-dimensional tube.
void serialize(const std::string &binary_file_name="x.tube", int version_number=SERIALIZATION_VERSION) const
Serializes this tube.
const TubeVector primitive() const
Returns the primitive TubeVector of this tube, with a zero constant of integration.
const TubeVector & operator|=(const IntervalVector &x)
Operates |=.
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9
int size() const
Returns the dimension of the tube.
const TubeVector & operator/=(const Interval &x)
Operates /=.
void resize(int n)
Resizes this TubeVector.
const TrajectoryVector diam(bool gates_thicknesses=false) const
Returns the diameters of the tube as a trajectory.
TubeVector & truncate_tdomain(const Interval &tdomain)
Truncates the tdomain of .
const IntervalVector codomain_box() const
Returns the box .
Slice of a one dimensional tube and made of an envelope and two gates.
Definition: codac_Slice.h:33
bool is_strict_superset(const TubeVector &x) const
Returns true if this tube is a superset of , and not itself.
static const TubeVector hull(const std::list< TubeVector > &l_tubes)
Computes the hull of several tubes.
const TrajectoryVector lb() const
Returns a possible lower bound of the tube.
One dimensional trajectory , defined as a temporal map of values.
Definition: codac_Trajectory.h:34
Tube & operator[](int index)
Returns the ith Tube of this TubeVector.
bool is_strict_subset(const TubeVector &x) const
Returns true if this tube is a subset of , and not itself.
static bool same_slicing(const TubeVector &x1, const Tube &x2)
Tests whether a TubeVector object shares the slicing of another Tube object.
const IntervalVector operator()(int slice_id) const
Returns the value of the ith slice.
const Slice * steepest_slice() const
Returns the slice of the Tube of this TubeVector with the largest difference between the mid values o...
bool is_empty() const
Returns true if this tube is empty.
Abstract class for common properties of Tube, TubeVector, Slice, Trajectory, TrajectoryVector objects...
Definition: codac_DynamicalItem.h:25
friend void deserialize_TubeVector(std::ifstream &bin_file, TubeVector *&tube)
Creates a TubeVector object from a binary file.
n-dimensional trajectory , defined as a temporal map of vector values
Definition: codac_TrajectoryVector.h:37
void deserialize(const std::string &binary_file_name, TrajectoryVector *&traj)
Restores a n-dimensional tube from serialization, together with a TrajectoryVector object...
int m_n
dimension of this tube
Definition: codac_TubeVector.h:1203
const std::pair< IntervalVector, IntervalVector > eval(const Interval &t=Interval::ALL_REALS) const
Returns the interval evaluations of the bounds of the tube and over .
const TrajectoryVector ub() const
Returns a possible upper bound of the tube.
~TubeVector()
TubeVector destructor.
const TubeVector & operator+=(const Interval &x)
Operates +=.
const Vector max_diam() const
Returns a vector of the maximum diameters of the tube for each component.
n-dimensional tube , defined as an interval of n-dimensional trajectories
Definition: codac_TubeVector.h:38
const IntervalVector integral(double t) const
Computes the box integral .
One dimensional tube , defined as an interval of scalar trajectories.
Definition: codac_Tube.h:47
const TubeVector & operator &=(const IntervalVector &x)
Operates &=.
bool is_subset(const TubeVector &x) const
Returns true if this tube is a subset of .
const TubeVector & set_empty()
Sets this tube to the empty set.
const TubeVector & operator*=(const Interval &x)
Operates *=.
const TubeVector & operator=(const TubeVector &x)
Returns a copy of a TubeVector.
Tube * m_v_tubes
array of components (scalar tubes)
Definition: codac_TubeVector.h:1204
const IntervalVector interpol(double t, const TubeVector &v) const
Returns the optimal evaluation of this tube at , based on the derivative information ...
double max_gate_diam(double &t) const
Returns the maximum diameter of all gates of the tube vector in all components.
const std::pair< TubeVector, TubeVector > bisect(double t, float ratio=0.49) const
Bisects this tube.
void enable_synthesis(SynthesisMode mode=SynthesisMode::BINARY_TREE, double eps=1.e-3) const
Enables the computation of a synthesis tree.
const Interval tdomain() const
Returns the temporal definition domain of this tube.
bool operator==(const TubeVector &x) const
Returns true if this tube is equal to .
int nb_slices() const
Returns the number of slices of this tube.
const IntervalVector codomain() const
Returns the box of feasible values.
bool overlaps(const TubeVector &x, float ratio=1.) const
Returns true if this tube overlaps the tube .
const TubeVector subvector(int start_index, int end_index) const
Returns a subvector of this TubeVector.
const TubeVector & inflate(double rad)
Inflates this tube by adding to all its codomain components.
friend std::ostream & operator<<(std::ostream &str, const TubeVector &x)
Displays a synthesis of this tube.
bool is_superset(const TubeVector &x) const
Returns true if this tube is a superset of .
void put(int start_index, const TubeVector &subvec)
Puts a subvector into this TubeVector at a given position.
double volume() const
Returns the volume of this tube.
const Interval invert(const IntervalVector &y, const Interval &search_tdomain=Interval::ALL_REALS) const
Returns the interval inversion .
void sample(double t)
Samples this tube at .
void shift_tdomain(double a)
Shifts the tdomain of .
bool operator!=(const TubeVector &x) const
Returns true if this tube is different from .
const TubeVector & operator-=(const Interval &x)
Operates -=.
const std::pair< IntervalVector, IntervalVector > partial_integral(const Interval &t) const
Computes the partial box integral .
const std::string class_name() const
Returns the name of this class.
Definition: codac_TubeVector.h:1021
const BoolInterval contains(const TrajectoryVector &x) const
Returns true if this tube contains the trajectory .
int time_to_index(double t) const
Returns the Slice index related to the temporal key .