|
codac 2.0.0
|
Temporal partition associated with sliced tubes. More...
#include <codac2_TDomain.h>
Public Member Functions | |
| Interval | t0_tf () const |
| Returns the global temporal domain \([t_0,t_f]\). | |
| size_t | nb_tslices () const |
| Returns the number of temporal elements stored in this partition. | |
| size_t | nb_tubes () const |
| Returns the number of sliced tubes attached to this temporal domain. | |
| bool | all_gates_defined () const |
| Tests whether all sampling gates are explicitly represented. | |
| std::vector< TSlice > | tslices_vector () const |
| Returns a copy of the temporal slices as a std::vector. | |
| std::list< TSlice >::iterator | tslice (double t) |
| Returns the temporal slice containing \(t\). | |
| std::list< TSlice >::iterator | sample (double t, bool with_gate=false) |
| Samples this temporal domain at time \(t\). | |
| void | sample (const Interval &t0_tf, double dt, bool with_gates=false) |
| Samples this temporal domain over a time interval. | |
| void | delete_gates () |
| Removes all explicit gates from this temporal domain. | |
Static Public Member Functions | |
| 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. | |
Protected Member Functions | |
| TDomain (const Interval &t0_tf) | |
| Creates a temporal domain made of a single TSlice. | |
| TDomain (const Interval &t0_tf, double dt, bool with_gates=true) | |
| Creates a sampled temporal domain over \([t_0,t_f]\). | |
Temporal partition associated with sliced tubes.
A TDomain stores an ordered list of TSlice objects defining the temporal decomposition of one or several sliced tubes over a time domain.
Each element of the list is either:
Gates are optional. When they are explicitly represented, the temporal partition typically alternates between gates and non-degenerate slices.
This object is shared by all SlicedTube instances defined on the same temporal partition.
|
explicitprotected |
Creates a temporal domain made of a single TSlice.
The resulting temporal domain contains only one slice over \([t_0,t_f]\).
| t0_tf | temporal interval \([t_0,t_f]\) |
|
explicitprotected |
Creates a sampled temporal domain over \([t_0,t_f]\).
The interval is subdivided with a nominal time step dt. If with_gates is set to true, degenerate temporal slices are inserted at sampling times.
| t0_tf | bounded non-degenerate temporal interval \([t_0,t_f]\) |
| dt | sampling step |
| with_gates | if set to true, explicit gates are inserted |
| Interval codac2::TDomain::t0_tf | ( | ) | const |
Returns the global temporal domain \([t_0,t_f]\).
| size_t codac2::TDomain::nb_tslices | ( | ) | const |
Returns the number of temporal elements stored in this partition.
The count includes both non-degenerate slices and gates.
| size_t codac2::TDomain::nb_tubes | ( | ) | const |
Returns the number of sliced tubes attached to this temporal domain.
| bool codac2::TDomain::all_gates_defined | ( | ) | const |
Tests whether all sampling gates are explicitly represented.
This method is intended to detect whether the temporal partition contains explicit degenerate slices between consecutive non-degenerate slices.
| std::vector< TSlice > codac2::TDomain::tslices_vector | ( | ) | const |
Returns a copy of the temporal slices as a std::vector.
| std::list< TSlice >::iterator codac2::TDomain::tslice | ( | double | t | ) |
Returns the temporal slice containing \(t\).
If \(t\) coincides with an explicit gate, the iterator points to this gate. If \(t=t_f\), the iterator points to the last stored TSlice rather than end().
| t | temporal value |
| std::list< TSlice >::iterator codac2::TDomain::sample | ( | double | t, |
| bool | with_gate = false ) |
Samples this temporal domain at time \(t\).
If needed, the current temporal partition is refined so that \(t\) becomes an explicit temporal boundary. If \(t\) lies outside the current temporal domain, the partition is extended accordingly.
| t | temporal value at which the partition is refined |
| with_gate | if set to true, an explicit gate is created at \(t\) |
| void codac2::TDomain::sample | ( | const Interval & | t0_tf, |
| double | dt, | ||
| bool | with_gates = false ) |
| void codac2::TDomain::delete_gates | ( | ) |
Removes all explicit gates from this temporal domain.
After this operation, only non-degenerate temporal slices remain.
|
static |
Tests whether two temporal domains share the same temporal partition.
Two temporal domains are considered identical if they contain the same ordered sequence of TSlice objects.
| tdom1 | first temporal domain |
| tdom2 | second temporal domain |