|
static const SBDTypePhysicalInterval< Quantity > | zero |
| The zero physical interval.
|
|
static const SBDTypePhysicalInterval< Quantity > | empty |
| The empty physical interval (+infinite, -infinite)
|
|
static const SBDTypePhysicalInterval< Quantity > | infinite |
| The infinite physical interval (-infinite, +infinite)
|
|
Quantity | i [2] |
| The components of the interval.
|
|
bool | isEmpty (const SBDTypePhysicalInterval< Quantity > u) const |
| Determines whether the intersection between this physical interval and the physical interval u is empty,.
|
|
bool | isEmpty (Quantity l, Quantity r) const |
| Determines whether the intersection between this physical interval and the physical interval [l , r ] is empty,.
|
|
Quantity | getAbsLower () const |
| Returns the lower bound of the absolute value of this physical interval.
|
|
Quantity | getAbsUpper () const |
| Returns the upper bound of the absolute value of this physical interval.
|
|
bool | contains (Quantity v) const |
| Returns true when this physical interval contains v .
|
|
bool | contains (const SBDTypePhysicalInterval< Quantity > &j) const |
| Returns true when this physical interval contains physical interval j .
|
|
void | bound (Quantity v) |
| Enlarges this physical interval to contain v .
|
|
void | bound (const SBDTypePhysicalInterval< Quantity > &j) |
| Enlarges this physical interval to contain the physical interval j .
|
|
void | expand (Quantity r) |
| Expands this physical interval by offset r .
|
|
void | shrink (Quantity r) |
| Shrinks this physical interval by offset r .
|
|
Quantity | center () const |
| Returns the center 0.5*(i[0]+i[1]) of the physical interval.
|
|
Quantity | diameter () const |
| Returns the diameter i[1]-i[0] of the physical interval.
|
|
void | setZero () |
| Sets the physical interval to [0,0].
|
|
void | print () const |
| Prints the physical interval.
|
|
template<typename QuantityLower , typename QuantityUpper > |
void | updateBounds (SBDTypePhysicalInterval< QuantityLower > &lower, SBDTypePhysicalInterval< QuantityUpper > &upper) const |
| Updates the lower and upper bounds with this physical interval.
|
|
|
SBDTypePhysicalInterval< Quantity > | operator+ (const SBDTypePhysicalInterval< Quantity > &u) const |
| Returns the sum of this physical interval and the physical interval u .
|
|
SBDTypePhysicalInterval< Quantity > | operator- (const SBDTypePhysicalInterval< Quantity > &u) const |
| Returns the difference between this physical interval and the physical interval u .
|
|
SBDTypePhysicalInterval< Quantity > | operator* (double d) const |
| Returns the result of the product of this physical interval with the double d .
|
|
template<typename QuantityB > |
SBDTypePhysicalInterval< SBQuantityType< typename SBDQuantityUnitMultiplication< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > | operator* (const QuantityB &d) const |
| Returns the product of this physical interval with the quantity d .
|
|
template<typename QuantityB > |
SBDTypePhysicalInterval< SBQuantityType< typename SBDQuantityUnitMultiplication< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > | operator* (const SBDTypePhysicalInterval< QuantityB > &in) const |
| Returns the product of this physical interval with the physical interval in .
|
|
template<typename QuantityB > |
SBDTypePhysicalInterval< Quantity > & | operator*= (QuantityB d) const |
| Multiplies this physical interval with the quantity d .
|
|
template<typename QuantityB > |
SBDTypePhysicalInterval< Quantity > & | operator*= (SBDTypePhysicalInterval< QuantityB > in) const |
| Multiplies this physical interval with the physical interval in .
|
|
SBDTypePhysicalInterval< Quantity > | operator/ (double d) const |
| Returns the result of the division of this physical interval by the double d .
|
|
template<typename QuantityB > |
SBDTypePhysicalInterval< SBQuantityType< typename SBDQuantityUnitDivision< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > | operator/ (QuantityB d) const |
| Returns the result of the division of this physical interval by the quantity d .
|
|
template<typename QuantityB > |
SBDTypePhysicalInterval< SBQuantityType< typename SBDQuantityUnitDivision< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > | operator/ (const SBDTypePhysicalInterval< QuantityB > &in) const |
| Returns the result of the division of this physical interval by the physical interval in .
|
|
template<typename QuantityB > |
SBDTypePhysicalInterval< Quantity > & | operator/= (QuantityB d) const |
| Divides this physical interval by the quantity d .
|
|
template<typename QuantityB > |
SBDTypePhysicalInterval< Quantity > & | operator/= (const SBDTypePhysicalInterval< QuantityB > &in) const |
| Divides this physical interval by the physical interval in .
|
|
SBDTypePhysicalInterval< Quantity > | operator- () const |
| Returns the opposite of this physical interval.
|
|
SBDTypePhysicalInterval< Quantity > & | operator+= (const SBDTypePhysicalInterval< Quantity > &u) |
| Adds the physical interval u to this physical interval.
|
|
SBDTypePhysicalInterval< Quantity > & | operator-= (const SBDTypePhysicalInterval< Quantity > &u) |
| Subtracts the physical interval u from this physical interval.
|
|
bool | operator^ (const SBDTypePhysicalInterval< Quantity > &u) |
| Intersects this physical interval with the physical interval u .
|
|
template<typename QuantityB > |
| operator SBDTypePhysicalInterval< QuantityB > () const |
| Converts this physical interval to a physical interval with units QuantityB .
|
|
SBDTypePhysicalInterval< Quantity > & | operator= (const SBDTypePhysicalInterval< Quantity > &u) |
| Copy assignment.
|
|
template<typename QuantityB > |
bool | operator== (const SBDTypePhysicalInterval< QuantityB > &u) const |
| Returns true when this physical interval is equal to physical interval u .
|
|
template<typename QuantityB > |
bool | operator!= (const SBDTypePhysicalInterval< QuantityB > &u) const |
| Returns true when this physical interval is different from physical interval u .
|
|
Quantity & | operator[] (int index) |
| Returns a reference to component index of this physical interval.
|
|
const Quantity & | operator[] (int index) const |
| Returns a reference to component index of this physical interval (const version)
|
|
template<typename Quantity>
class SBDTypePhysicalInterval< Quantity >
- Template Parameters
-
Quantity | The quantity type of the interval |
This template class is used to describe physical intervals.
Physical intervals are physical quantities, and thus use SAMSON's unit system. In a physical interval (e.g. an energy interval), both bounds have the same unit, so that physical intervals are defined by only one unit, and the SBDTypePhysicalInterval template class is parameterized by only one type: Quantity
.
This class may be used to perform interval arithmetics (IA), i.e. arithmetics with intervals instead of numbers, with physical quantities.
Most of the time, developers of SAMSON Extensions do not have to use this template, but may directly use some predefined types that correspond to specific instantiations of this template class, e.g. SBInterval (dimensionless interval), SBEnergyInterval (energy interval), SBPositionInterval (position interval), etc.
Interval arithmetics may be particularly useful to compute bounds on physical quantities:
);
);
This template class defines physical quantity types.
Definition: SBDQuantityType.hpp:43
This template class represents three-dimensional physical interval vectors.
Definition: SBDTypePhysicalIAVector3.hpp:65
This template class is used to describe physical intervals.
Definition: SBDTypePhysicalInterval.hpp:61
Short name: SBPhysicalInterval
- See also
- SAMSON's unit system
-
The SBDType library
-
SBDTypePhysicalIAVector3