22 TubeComponent(Tube<T>& tubevector,
size_t i) :
23 _i(i), _tubevector(tubevector)
25 assert(i >= 0 && i < tubevector.size());
30 TubeComponent(
const TubeComponent<T>& tubevector_i) :
31 _i(tubevector_i._i), _tubevector(tubevector_i._tubevector)
41 const std::shared_ptr<TDomain>& tdomain()
const
43 return _tubevector.tdomain();
46 Interval t0_tf()
const
48 return _tubevector.t0_tf();
51 Interval codomain()
const
53 Interval codomain(Interval::empty());
54 for(
const auto& s : _tubevector)
55 codomain |= s.codomain()[_i];
65 void set(
const Interval& codomain)
67 for(
auto& s : _tubevector)
68 s.set_component(_i, codomain);
71 const TubeComponent<T>& operator=(
const TubeComponent<T>& x)
73 assert(x.tdomain() == tdomain());
74 for(
auto& s : _tubevector)
75 s.set_component(_i, std::static_pointer_cast<Slice<T>>(s._it_tslice->_slices.at(&x._tubevector))->codomain()[x._i]);
79 const TubeComponent<T>& operator=(std::pair<std::function<Interval(
const Interval&)>,
const TubeComponent<T>> rel)
81 assert(rel.second.tdomain() == tdomain());
82 for(
auto& s : _tubevector)
83 s.set_component(_i, rel.first(std::static_pointer_cast<Slice<T>>(s._it_tslice->_slices.at(&rel.second._tubevector))->codomain()[rel.second._i]));
87 friend std::ostream&
operator<<(std::ostream& os,
const TubeComponent<T>& x)
89 os <<
"Component " << x._i <<
" of: " << x._tubevector << std::flush;
93 std::pair<std::function<Interval(
const Interval&)>,
const TubeComponent<T>>
cos(
const TubeComponent<T>& x)
95 return std::make_pair(
static_cast<Interval(*)(
const Interval&)
>(cos), x);
102 Tube<T>& _tubevector;
109 std::pair<std::function<
Interval(
const Interval&)>,
const TubeComponent<T>>
cos(
const TubeComponent<T>& x);
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:62
std::ostream & operator<<(std::ostream &os, const BoolInterval &x)
Streams out a BoolInterval.
Definition codac2_BoolInterval.h:45
Interval cos(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:98