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

Temporal slice shared by sliced tubes. More...

#include <codac2_TSlice.h>

Inheritance diagram for codac2::TSlice:
Collaboration diagram for codac2::TSlice:

Public Member Functions

 TSlice (const Interval &tdomain)
 Creates a temporal slice over the given time interval.
 TSlice (const TSlice &tslice, const Interval &tdomain)
 Creates a temporal slice from another one over a new time interval.
bool is_gate () const
 Tests whether this temporal slice is a gate.
const std::map< const SlicedTubeBase *, std::shared_ptr< SliceBase > > & slices () const
 Returns the slices attached to this temporal slice.
bool operator== (const Interval &x) const
 Comparison (equality) between two intervals.
Public Member Functions inherited from codac2::Interval
 Interval ()
 Creates an interval \([-\infty,\infty]\).
 Interval (double a)
 Creates a degenerate interval \([a,a]\), \(a\in\mathbb{R}\).
 Interval (double a, double b)
 Creates an interval \([a,b]\), \(a\in\mathbb{R}, b\in\mathbb{R}\).
 Interval (const Interval &x)
 Creates an interval from another one.
 Interval (const std::array< double, 1 > &array)
 Create an interval \([a,a]\) from a fixed-sized array of size 1.
 Interval (const std::array< double, 2 > &array)
 Create an interval \([a,b]\) from a fixed-sized array of size 2.
 Interval (std::initializer_list< double > l)
 Create an interval as the hull of a list of values.
Intervalinit ()
 Sets the value of this interval to [-oo,oo].
Intervalinit (const Interval &x)
 Sets the value of this interval to x.
Intervalinit_from_list (const std::list< double > &l)
 Sets the bounds as the hull of a list of values.
Intervaloperator= (double x)
 Sets this to x.
Intervaloperator= (const Interval &x)
 Sets this to x.
bool operator== (const Interval &x) const
 Comparison (equality) between two intervals.
bool operator!= (const Interval &x) const
 Comparison (non equality) between two intervals.
double lb () const
 Returns the lower bound of this.
double ub () const
 Returns the upper bound of this.
double mid () const
 Returns the midpoint of this.
double mag () const
 Returns the magnitude of this i.e. max(|lower bound|, |upper bound|).
double mig () const
 Returns the mignitude of this.
double smag () const
 Returns the signed magnitude of this i.e. lower bound if |lower bound|>|upper bound|, upper bound otherwise.
double smig () const
 Returns the signed mignitude of this.
double rand () const
 Returns a random value inside the interval.
double rad () const
 Returns the radius of this.
double diam () const
 Returns the diameter of this.
double volume () const
 Returns the diameter of this.
Index size () const
 Returns the dimension of this (which is always ).
void set_empty ()
 Sets this interval to the empty set.
bool is_empty () const
 Tests if this is empty.
bool contains (const double &x) const
 Tests if this contains x.
bool interior_contains (const double &x) const
 Tests if the interior of this contains x.
bool is_unbounded () const
 Tests if one of the bounds of this is infinite.
bool is_degenerated () const
 Tests if this is degenerated, that is, in the form of \([a,a]\).
bool is_integer () const
 Tests if this is an integer, that is, in the form of \([n,n]\) where n is an integer.
bool has_integer_bounds () const
 Checks whether the interval has integer lower and upper bounds.
bool intersects (const Interval &x) const
 Tests if this and x intersect.
bool is_disjoint (const Interval &x) const
 Tests if this and x do not intersect.
bool overlaps (const Interval &x) const
 Tests if this and x intersect and their intersection has a non-null volume.
bool is_subset (const Interval &x) const
 Tests if this is a subset of x.
bool is_strict_subset (const Interval &x) const
 Tests if this is a subset of x and not x itself.
bool is_interior_subset (const Interval &x) const
 Tests if this is in the interior of x.
bool is_strict_interior_subset (const Interval &x) const
 Tests if this is in the interior of x and different from x.
bool is_superset (const Interval &x) const
 Tests if this is a superset of x.
bool is_strict_superset (const Interval &x) const
 Tests if this is a superset of x and different from x.
Intervalinflate (const double &rad)
 Adds [-rad,+rad] to this.
bool is_bisectable () const
 Tests if this can be bisected into two non-degenerated intervals.
std::pair< Interval, Intervalbisect (float ratio=0.49) const
 Bisects this into two subintervals.
std::vector< Intervalcomplementary (bool compactness=true) const
 Computes the complementary of this.
std::vector< Intervaldiff (const Interval &y, bool compactness=true) const
 Computes the result of \([x]\backslash[y]\).
Intervaloperator|= (const Interval &x)
 Self union of this and x.
Intervaloperator&= (const Interval &x)
 Self intersection of this and x.
Intervaloperator+= (double x)
 Self addition of this and a real x.
Intervaloperator+= (const Interval &x)
 Self addition of this and x.
Interval operator- () const
 Substraction of this.
Intervaloperator-= (double x)
 Self substraction of this and a real x.
Intervaloperator-= (const Interval &x)
 Self substraction of this and x.
Intervaloperator*= (double x)
 Self multiplication of this and a real x.
Intervaloperator*= (const Interval &x)
 Self multiplication of this and x.
Intervaloperator/= (double x)
 Self division of this and a real x.
Intervaloperator/= (const Interval &x)
 Self division of this and x.

Protected Attributes

std::map< const SlicedTubeBase *, std::shared_ptr< SliceBase > > _slices
 Slices attached to each sliced tube over this temporal interval.

Additional Inherited Members

Static Public Member Functions inherited from codac2::Interval
static Interval empty ()
 Provides an empty interval.
static Interval zero ()
 Provides an interval for \([0]\).
static Interval one ()
 Provides an interval for \([1]\).
static Interval half_pi ()
 Provides an interval for \([\frac{\pi}{2}]\).
static Interval pi ()
 Provides an interval for \([\pi]\).
static Interval two_pi ()
 Provides an interval for \([2\pi]\).

Detailed Description

Temporal slice shared by sliced tubes.

A TSlice represents a temporal interval of a TDomain. It inherits from Interval and may correspond either to:

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

For each sliced tube defined on the same temporal partition, this object stores the corresponding SliceBase instance.

Constructor & Destructor Documentation

◆ TSlice() [1/2]

codac2::TSlice::TSlice ( const Interval & tdomain)
explicit

Creates a temporal slice over the given time interval.

Parameters
tdomaintemporal interval associated with this slice

◆ TSlice() [2/2]

codac2::TSlice::TSlice ( const TSlice & tslice,
const Interval & tdomain )

Creates a temporal slice from another one over a new time interval.

This constructor duplicates the slice container associated with each tube by performing a deep copy of the underlying SliceBase objects.

Parameters
tslicesource temporal slice
tdomaintemporal interval associated with the copied slice

Member Function Documentation

◆ is_gate()

bool codac2::TSlice::is_gate ( ) const

Tests whether this temporal slice is a gate.

A temporal slice is considered as a gate when its temporal interval is degenerate, i.e., when \(t^-=t^+\).

Returns
true if this slice is a gate, false otherwise

◆ slices()

const std::map< const SlicedTubeBase *, std::shared_ptr< SliceBase > > & codac2::TSlice::slices ( ) const

Returns the slices attached to this temporal slice.

The returned map associates each SlicedTubeBase defined on the same temporal partition with its corresponding SliceBase over this temporal interval.

Returns
constant reference to the map of attached slices

◆ operator==()

bool codac2::Interval::operator== ( const Interval & x) const
inline

Comparison (equality) between two intervals.

Parameters
xinterval to be compared with
Returns
true iff this and x are exactly the same intervals
101 {
102 return (is_empty() && x.is_empty()) || (lb() == x.lb() && ub() == x.ub());
103 }
bool is_empty() const
Tests if this is empty.
Definition codac2_Interval_impl.h:205
double ub() const
Returns the upper bound of this.
Definition codac2_Interval_impl.h:115
double lb() const
Returns the lower bound of this.
Definition codac2_Interval_impl.h:110

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