codac 1.5.6
Loading...
Searching...
No Matches
codac_Slice.h
Go to the documentation of this file.
1
12#ifndef __CODAC_SLICE_H__
13#define __CODAC_SLICE_H__
14
15#include "codac_Tube.h"
16#include "codac_Trajectory.h"
17#include "codac_DynamicalItem.h"
18#include "codac_ConvexPolygon.h"
19#include "codac_TubeTreeSynthesis.h"
20#include "codac_BoolInterval.h"
21
22namespace codac
23{
24 #define EPSILON_CONTAINS ibex::next_float(0.) * 1000.
25
26 class Tube;
27 class Trajectory;
28
33 class Slice : public DynamicalItem
34 {
35 public:
36
37 // Base:
38
41
48 explicit Slice(const Interval& tdomain, const Interval& codomain = Interval::ALL_REALS);
49
55 Slice(const Slice& x);
56
61
67 int size() const;
68
75 const Slice& operator=(const Slice& x);
76
82 const Interval tdomain() const;
83
87
94
100 const Slice* prev_slice() const;
101
108
114 const Slice* next_slice() const;
115
121 const Interval input_gate() const;
122
128 const Interval output_gate() const;
129
139 const ConvexPolygon polygon(const Slice& v) const;
140
144
150 const Interval codomain() const;
151
157 const IntervalVector box() const;
158
170 static double diam(const Interval& interval);
171
180 double diam() const;
181
190 double volume() const;
191
200 const Interval operator()(double t) const;
201
208 const Interval operator()(const Interval& t) const;
209
218 const std::pair<Interval,Interval> eval(const Interval& t = Interval::ALL_REALS) const;
219
230 const Interval interpol(double t, const Slice& v) const;
231
242 const Interval interpol(const Interval& t, const Slice& v) const;
243
251 const Interval invert(const Interval& y, const Interval& search_tdomain = Interval::ALL_REALS) const;
252
263 const Interval invert(const Interval& y, const Slice& v, const Interval& search_tdomain = Interval::ALL_REALS) const;
264
268
278 bool operator==(const Slice& x) const;
279
289 bool operator!=(const Slice& x) const;
290
299 bool is_subset(const Slice& x) const;
300
310 bool is_strict_subset(const Slice& x) const;
311
320 bool is_interior_subset(const Slice& x) const;
321
331 bool is_strict_interior_subset(const Slice& x) const;
332
341 bool is_superset(const Slice& x) const;
342
352 bool is_strict_superset(const Slice& x) const;
353
362 bool is_empty() const;
363
377 const BoolInterval contains(const Trajectory& x) const;
378
382
390 void set(const Interval& y);
391
397 void set_empty();
398
408 void set_envelope(const Interval& envelope, bool slice_consistency = true);
409
421 void set_input_gate(const Interval& input_gate, bool slice_consistency = true);
422
434 void set_output_gate(const Interval& output_gate, bool slice_consistency = true);
435
444 const Slice& inflate(double rad);
445
449
456 Slice& operator+=(double x);
457
465
473
480 Slice& operator-=(double x);
481
489
497
504 Slice& operator*=(double x);
505
513
521
528 Slice& operator/=(double x);
529
537
545
552 Slice& operator|=(double x);
553
561
569
576 Slice& operator&=(double x);
577
585
593
597
605 const std::string class_name() const { return "Slice"; };
606
614 friend std::ostream& operator<<(std::ostream& str, const Slice& x);
615
617
618 protected:
619
627 void set_tdomain(const Interval& tdomain);
628
634 void shift_tdomain(double a);
635
645 static void chain_slices(Slice *first_slice, Slice *second_slice);
646
656 static void merge_slices(Slice *first_slice, Slice *&second_slice);
657
665 const IntervalVector codomain_box() const;
666
667 // Class variables:
668
669 Interval m_tdomain;
670 Interval m_codomain = Interval::ALL_REALS;
671 Interval *m_input_gate = nullptr, *m_output_gate = nullptr;
672 Slice *m_prev_slice = nullptr, *m_next_slice = nullptr;
673 mutable TubeTreeSynthesis *m_synthesis_reference = nullptr;
674
675 friend class Tube;
676 friend class TubeTreeSynthesis;
677 friend class CtcEval;
678 friend void deserialize_Tube(std::ifstream& bin_file, Tube *&tube);
679 };
680}
681
682#endif
that contracts a tube with respect to its derivative tube and a measurement according to the const...
Definition codac_CtcEval.h:27
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
const Slice & operator=(const Slice &x)
Returns a copy of a Slice.
const Slice * next_slice() const
Points to the next slice .
const Slice & inflate(double rad)
Inflates this slice by adding to all its codomain components.
bool operator!=(const Slice &x) const
Returns true if this slice is different from .
static void chain_slices(Slice *first_slice, Slice *second_slice)
Chains the two slices so that they share pointers and a common gate.
const std::pair< Interval, Interval > eval(const Interval &t=Interval::ALL_REALS) const
Returns the interval evaluations of the bounds of the slice over .
Slice & operator/=(const Slice &x)
Operates /=.
bool is_superset(const Slice &x) const
Returns true if this slice is a superset of .
TubeTreeSynthesis * m_synthesis_reference
pointer to a leaf of the optional synthesis tree of the related tube
Definition codac_Slice.h:673
double volume() const
Returns the volume of this slice.
Slice * next_slice()
Points to the next slice .
double diam() const
Returns the diameter of this slice.
const std::string class_name() const
Returns the name of this class.
Definition codac_Slice.h:605
const IntervalVector box() const
Computes the two-dimensional box .
const Interval operator()(const Interval &t) const
Returns the interval evaluation of this slice over .
const Interval interpol(const Interval &t, const Slice &v) const
Returns the optimal evaluation of this slice over , based on the derivative information .
Slice & operator/=(const Trajectory &x)
Operates /=.
const Interval invert(const Interval &y, const Slice &v, const Interval &search_tdomain=Interval::ALL_REALS) const
Returns the optimal interval inversion .
Slice & operator-=(double x)
Operates -=.
bool is_interior_subset(const Slice &x) const
Returns true if this slice is a subset of the interior of .
Slice & operator*=(const Trajectory &x)
Operates *=.
Interval m_codomain
envelope of the slice
Definition codac_Slice.h:670
const IntervalVector codomain_box() const
Returns the box .
static double diam(const Interval &interval)
Returns the diameter of an interval (IBEX overload)
Slice & operator&=(const Trajectory &x)
Operates &=.
void set_output_gate(const Interval &output_gate, bool slice_consistency=true)
Sets the interval value of the output gate of this slice.
Slice & operator-=(const Slice &x)
Operates -=.
Slice(const Interval &tdomain, const Interval &codomain=Interval::ALL_REALS)
Creates a slice .
const ConvexPolygon polygon(const Slice &v) const
Computes a convex polygon that optimally encloses the values of the slice according to the knowledge ...
const Slice * prev_slice() const
Points to the previous slice .
Slice & operator+=(const Slice &x)
Operates +=.
Interval * m_output_gate
input and output gates
Definition codac_Slice.h:671
static void merge_slices(Slice *first_slice, Slice *&second_slice)
Merges the two slices to keep only one.
const Interval output_gate() const
Returns the value of the output gate of this slice.
const Interval interpol(double t, const Slice &v) const
Returns the optimal evaluation of this slice at , based on the derivative information .
void set_tdomain(const Interval &tdomain)
Specifies the temporal domain of this slice.
const Interval tdomain() const
Returns the temporal definition domain of this slice.
Slice & operator+=(double x)
Operates +=.
bool is_subset(const Slice &x) const
Returns true if this slice is a subset of .
const Interval codomain() const
Returns the envelope of the slice.
void set_empty()
Sets this slice to the empty set.
Slice & operator&=(const Slice &x)
Operates &=.
Slice & operator&=(double x)
Operates &=.
void shift_tdomain(double a)
Shifts the tdomain of .
Slice & operator-=(const Trajectory &x)
Operates -=.
friend void deserialize_Tube(std::ifstream &bin_file, Tube *&tube)
Creates a Tube object from a binary file.
Slice * m_next_slice
pointers to previous and next slices of the related tube
Definition codac_Slice.h:672
void set(const Interval &y)
Sets a constant interval value for this slice: .
void set_input_gate(const Interval &input_gate, bool slice_consistency=true)
Sets the interval value of the input gate of this slice.
const Interval operator()(double t) const
Returns the evaluation of this slice at .
bool operator==(const Slice &x) const
Returns true if this slice is equal to .
const Interval input_gate() const
Returns the value of the input gate of this slice.
bool is_strict_superset(const Slice &x) const
Returns true if this slice is a superset of , and not itself.
Slice & operator*=(double x)
Operates *=.
bool is_strict_subset(const Slice &x) const
Returns true if this slice is a subset of , and not itself.
bool is_empty() const
Returns true if this slice is empty.
Slice(const Slice &x)
Creates a copy of the slice .
friend std::ostream & operator<<(std::ostream &str, const Slice &x)
Displays a synthesis of this slice.
Interval m_tdomain
temporal domain of the slice
Definition codac_Slice.h:669
Slice & operator|=(const Trajectory &x)
Operates |=.
Slice & operator/=(double x)
Operates /=.
void set_envelope(const Interval &envelope, bool slice_consistency=true)
Sets the interval value of the envelope of this slice.
const Interval invert(const Interval &y, const Interval &search_tdomain=Interval::ALL_REALS) const
Returns the interval inversion .
~Slice()
Slice destructor.
Slice & operator*=(const Slice &x)
Operates *=.
int size() const
Returns the dimension of the slice (always 1)
const BoolInterval contains(const Trajectory &x) const
Returns true if this slice contains the trajectory .
Slice * prev_slice()
Points to the previous slice .
Slice & operator+=(const Trajectory &x)
Operates +=.
Slice & operator|=(double x)
Operates |=.
bool is_strict_interior_subset(const Slice &x) const
Returns true if this slice is a subset of the interior of , and not itself.
Slice & operator|=(const Slice &x)
Operates |=.
One dimensional trajectory , defined as a temporal map of values.
Definition codac_Trajectory.h:35
One dimensional tube , defined as an interval of scalar trajectories.
Definition codac_Tube.h:48
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition codac_capd_helpers.h:9