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