24 if(partial_integ.first.is_empty() || partial_integ.second.is_empty())
27 else if(partial_integ.first.is_unbounded() || partial_integ.second.is_unbounded())
31 return T(partial_integ.first.lb()) | partial_integ.second.ub();
58 const auto& x = this->
slice(it)->codomain();
65 return t1.
lb() < t2.
lb() ? p : T(-p);
69 if(p.first.is_empty() || p.second.is_empty())
71 if(p.first.is_unbounded() || p.second.is_unbounded())
74 if(t1.
ub() <= t2.
lb())
75 return T(p.first.lb()) | p.second.ub();
76 if(t2.
ub() <= t1.
lb())
77 return T(p.second.lb()) | p.first.ub();
79 return p.first | p.second;
93 return { zero, zero };
95 std::pair<T,T> p { zero, zero };
98 for(
const auto& s : *
this)
100 if(s.t0_tf().lb() >= t.
ub())
105 const auto& x = s.codomain();
116 result.first |= p.first + dt * T(x.lb());
117 result.second |= p.second + dt * T(x.ub());
120 if(s.t0_tf().ub() >= t.
ub())
124 p.first += dt * T(x.lb());
125 p.second += dt * T(x.ub());
137 integ_t2.first - integ_t1.first,
138 integ_t2.second - integ_t1.second
148 for(
const auto& s : *
this)
150 assert_release(!s.codomain().is_empty() && !s.codomain().is_unbounded());
155 std::piecewise_construct,
156 std::forward_as_tuple(this->
tdomain(), zero),
157 std::forward_as_tuple(this->
tdomain(), zero));
159 std::pair<T,T> p { zero, zero };
163 auto pm = primitives.first.slice(it);
164 auto pp = primitives.second.slice(it);
169 pm->set(p.first,
false);
170 pp->set(p.second,
false);
174 const auto& x = this->
slice(it)->codomain();
179 q.first += dt * T(x.lb());
180 q.second += dt * T(x.ub());
184 pm->set(p.first | q.first,
false);
185 pp->set(p.second | q.second,
false);
197 if(p.first.is_empty() || p.second.is_empty())
199 if(p.first.is_unbounded() || p.second.is_unbounded())
201 return T(p.first.lb()) | p.second.ub();
209 if(p.first.is_empty() || p.second.is_empty())
211 if(p.first.is_unbounded() || p.second.is_unbounded())
214 if(t1.
ub() <= t2.
lb())
215 return T(p.first.lb()) | p.second.ub();
216 if(t2.
ub() <= t1.
lb())
217 return T(p.second.lb()) | p.first.ub();
220 return p.first | p.second;
232 assert_release(primitives.first.tdomain() == this->tdomain() &&
233 primitives.second.tdomain() == this->tdomain());
236 assert(it !=
_tdomain->end() && it->contains(t.
lb()));
240 for(; it !=
_tdomain->cend() && it->lb() <= t.
ub(); ++it)
242 const Interval ti = t & it->t0_tf();
243 const auto pm = primitives.first.slice(it);
244 const auto pp = primitives.second.slice(it);
245 std::pair<T,T> q { pm->codomain(), pp->codomain() };
249 const auto& x = this->
slice(it)->codomain();
251 if(!q.first.is_unbounded() && !q.second.is_unbounded() && ti != it->t0_tf())
256 auto pm0 = pm->input_gate();
257 auto pp0 = pp->input_gate();
258 if(it->lb() == this->t0_tf().lb())
263 q.first &= pm0 + dt * T(x.lb());
264 q.second &= pp0 + dt * T(x.ub());
268 q.first &= pm->output_gate() - dtf * T(x.lb());
269 q.second &= pp->output_gate() - dtf * T(x.ub());
274 p.second |= q.second;
276 if(it->ub() >= t.
ub())
289 return { p2.first - p1.first, p2.second - p1.second };
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:50
bool is_unbounded() const
Tests if one of the bounds of this is infinite.
Definition codac2_Interval_impl.h:236
bool is_empty() const
Tests if this is empty.
Definition codac2_Interval_impl.h:221
double ub() const
Returns the upper bound of this.
Definition codac2_Interval_impl.h:131
bool is_degenerated() const
Tests if this is degenerated, that is, in the form of .
Definition codac2_Interval_impl.h:241
bool is_subset(const Interval &x) const
Tests if this is a subset of x.
Definition codac2_Interval_impl.h:271
double lb() const
Returns the lower bound of this.
Definition codac2_Interval_impl.h:126
SlicedTube(const std::shared_ptr< TDomain > &tdomain, const T &codomain)
Creates a sliced tube with constant codomain over all temporal slices.
Definition codac2_SlicedTube.h:47
T all_reals_value() const
Returns the unbounded codomain value associated with T.
Definition codac2_SlicedTube.h:1213
T empty_value() const
Returns the empty codomain value associated with T.
Definition codac2_SlicedTube.h:1225
std::pair< SlicedTube< T >, SlicedTube< T > > partial_primitives() const
Returns the primitives of the lower and upper bounds of this tube .
Definition codac2_SlicedTube_integral_impl.h:143
std::shared_ptr< Slice< T > > slice(const std::list< TSlice >::iterator &it)
Returns the slice attached to a temporal iterator.
Definition codac2_SlicedTube.h:249
const std::shared_ptr< TDomain > _tdomain
Shared temporal domain of this tube.
Definition codac2_TubeBase.h:71
Interval t0_tf() const
Returns the global temporal interval of this tube.
Definition codac2_TubeBase.h:61
const std::shared_ptr< TDomain > & tdomain() const
Returns the temporal domain of this tube.
Definition codac2_TubeBase.h:49
auto lb() const
Returns a matrix containing the lower bounds of each interval element.
Definition codac2_MatrixBase_addons_IntervalMatrixBase.h:91
std::pair< T, T > partial_integral(const Interval &t) const
Returns lower and upper enclosures of the integrals of this tube from to .
Definition codac2_SlicedTube_integral_impl.h:83
T integral(const Interval &t) const
Returns an enclosure of the integrals of this tube from to .
Definition codac2_SlicedTube_integral_impl.h:20
Definition codac2_OctaSym.h:21