codac 2.0.0
Loading...
Searching...
No Matches
codac2_TDomain.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <list>
13#include <memory>
14#include "codac2_TSlice.h"
15
16namespace codac2
17{
35 class TDomain : public std::list<TSlice>
36 {
37 protected:
38
46 explicit TDomain(const Interval& t0_tf);
47
59 explicit TDomain(const Interval& t0_tf, double dt, bool with_gates = true);
60
61 public:
62
68 Interval t0_tf() const;
69
77 size_t nb_tslices() const;
78
84 size_t nb_tubes() const;
85
95 bool all_gates_defined() const;
96
102 std::vector<TSlice> tslices_vector() const;
103
114 std::list<TSlice>::iterator tslice(double t);
115
127 std::list<TSlice>::iterator sample(double t, bool with_gate = false);
128
139 void sample(const Interval& t0_tf, double dt, bool with_gates = false);
140
147
157 void truncate(const Interval& new_tdomain);
158
169 friend std::ostream& operator<<(std::ostream& os, const TDomain& x);
170
182 static bool are_same(const std::shared_ptr<const TDomain>& tdom1, const std::shared_ptr<const TDomain>& tdom2);
183
184 protected:
185
186 friend std::shared_ptr<TDomain> create_tdomain(const Interval&);
187 friend std::shared_ptr<TDomain> create_tdomain(const Interval&,double,bool);
188 };
189
199 std::shared_ptr<TDomain> create_tdomain(const Interval& t0_tf = Interval(-oo,oo));
200
212 std::shared_ptr<TDomain> create_tdomain(const Interval& t0_tf, double dt, bool with_gates = true);
213}
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:49
void truncate(const Interval &new_tdomain)
Restricts this temporal domain to a subdomain.
size_t nb_tslices() const
Returns the number of temporal elements stored in this partition.
friend std::shared_ptr< TDomain > create_tdomain(const Interval &)
Creates a temporal domain made of a single slice.
void delete_gates()
Removes all explicit gates from this temporal domain.
static bool are_same(const std::shared_ptr< const TDomain > &tdom1, const std::shared_ptr< const TDomain > &tdom2)
Tests whether two temporal domains share the same temporal partition.
std::vector< TSlice > tslices_vector() const
Returns a copy of the temporal slices as a std::vector.
friend std::shared_ptr< TDomain > create_tdomain(const Interval &, double, bool)
Creates a sampled temporal domain.
friend std::ostream & operator<<(std::ostream &os, const TDomain &x)
Stream output for a temporal domain.
Interval t0_tf() const
Returns the global temporal domain .
TDomain(const Interval &t0_tf)
Creates a temporal domain made of a single TSlice.
void sample(const Interval &t0_tf, double dt, bool with_gates=false)
Samples this temporal domain over a time interval.
size_t nb_tubes() const
Returns the number of sliced tubes attached to this temporal domain.
TDomain(const Interval &t0_tf, double dt, bool with_gates=true)
Creates a sampled temporal domain over .
bool all_gates_defined() const
Tests whether all sampling gates are explicitly represented.
std::list< TSlice >::iterator tslice(double t)
Returns the temporal slice containing .
std::list< TSlice >::iterator sample(double t, bool with_gate=false)
Samples this temporal domain at time .
Definition codac2_OctaSym.h:21
std::shared_ptr< TDomain > create_tdomain(const Interval &t0_tf=Interval(-oo, oo))
Creates a temporal domain made of a single slice.