codac 2.0.0
Loading...
Searching...
No Matches
codac2::TDomain Class Reference

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]\).

Detailed Description

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:

  • a non-degenerate temporal slice \([t_i,t_{i+1}]\), or
  • a degenerate slice \([t_i,t_i]\), referred to as a gate.

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.

Constructor & Destructor Documentation

◆ TDomain() [1/2]

codac2::TDomain::TDomain ( const Interval & t0_tf)
explicitprotected

Creates a temporal domain made of a single TSlice.

The resulting temporal domain contains only one slice over \([t_0,t_f]\).

Parameters
t0_tftemporal interval \([t_0,t_f]\)

◆ TDomain() [2/2]

codac2::TDomain::TDomain ( const Interval & t0_tf,
double dt,
bool with_gates = true )
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.

Parameters
t0_tfbounded non-degenerate temporal interval \([t_0,t_f]\)
dtsampling step
with_gatesif set to true, explicit gates are inserted

Member Function Documentation

◆ t0_tf()

Interval codac2::TDomain::t0_tf ( ) const

Returns the global temporal domain \([t_0,t_f]\).

Returns
hull of the first and last temporal bounds stored in this object

◆ nb_tslices()

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.

Returns
number of TSlice objects

◆ nb_tubes()

size_t codac2::TDomain::nb_tubes ( ) const

Returns the number of sliced tubes attached to this temporal domain.

Returns
number of tubes sharing this TDomain

◆ all_gates_defined()

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.

Returns
true if the temporal partition explicitly contains its gates, false otherwise

◆ tslices_vector()

std::vector< TSlice > codac2::TDomain::tslices_vector ( ) const

Returns a copy of the temporal slices as a std::vector.

Returns
vector containing the TSlice objects of this temporal domain

◆ tslice()

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().

Parameters
ttemporal value
Returns
iterator to the corresponding TSlice; end() if \(t\notin[t_0,t_f]\)

◆ sample() [1/2]

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.

Parameters
ttemporal value at which the partition is refined
with_gateif set to true, an explicit gate is created at \(t\)
Returns
iterator to the TSlice associated with \(t\)

◆ sample() [2/2]

void codac2::TDomain::sample ( const Interval & t0_tf,
double dt,
bool with_gates = false )

Samples this temporal domain over a time interval.

The partition is refined repeatedly over the interval t0_tf using the step dt.

Parameters
t0_tftemporal interval to be sampled
dtsampling step
with_gatesif set to true, explicit gates are created

◆ delete_gates()

void codac2::TDomain::delete_gates ( )

Removes all explicit gates from this temporal domain.

After this operation, only non-degenerate temporal slices remain.

◆ are_same()

bool codac2::TDomain::are_same ( const std::shared_ptr< const TDomain > & tdom1,
const std::shared_ptr< const TDomain > & tdom2 )
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.

Parameters
tdom1first temporal domain
tdom2second temporal domain
Returns
true if both temporal domains define the same partition, false otherwise

The documentation for this class was generated from the following file: