SyDEVS  v0.6.5
Multiscale Simulation and Systems Modeling Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sydevs::quantity< no_units > Class Template Reference

A speciaulization to facilitate the conversion of dimensionless quantities into floats. More...

#include <quantity.h>

Inherits sydevs::quantity_base.

Public Member Functions

constexpr quantity ()
 
constexpr quantity (int64 multiplier)
 
constexpr quantity (int64 multiplier, scale precision)
 
constexpr quantity (const quantity &)=default
 Copy constructor. More...
 
quantityoperator= (const quantity &)=default
 Copy assignment. More...
 
 quantity (quantity &&)=default
 Move constructor. More...
 
quantityoperator= (quantity &&)=default
 Move assignment. More...
 
 ~quantity ()=default
 Destructor. More...
 
constexpr const quantity fixed_at (scale precision) const
 Returns a new quantity value with the length precision changed and fixed. More...
 
constexpr const quantity rescaled (scale precision) const
 Returns a new quantity value with the length precision changed but neither fixed nor unfixed. More...
 
constexpr const quantity refined () const
 Returns a new quantity value with the length precision minimized without losing precision. More...
 
constexpr const quantity coarsened () const
 Returns a new quantity value with the length precision maximized without losing precision. More...
 
constexpr const quantity unfixed () const
 Returns a new quantity value with the length precision unfixed. More...
 
constexpr const quantity operator+ () const
 Returns a copy of the quantity value. More...
 
constexpr const quantity operator- () const
 Returns the negation of the quantity value. More...
 
constexpr const quantity operator+ (quantity rhs) const
 Returns a new quantity value with rhs added. More...
 
constexpr const quantity operator- (quantity rhs) const
 Returns a new quantity value with rhs subtracted. More...
 
constexpr const quantity operator* (float64 rhs) const
 Returns a new quantity value multiplied by rhs. More...
 
constexpr const quantity operator/ (float64 rhs) const
 Returns a new quantity value divided by rhs. More...
 
template<typename U_ >
constexpr quantity< U_ > operator* (quantity< U_ > rhs) const
 Returns the quantity value multiplied by rhs. More...
 
template<typename U_ >
constexpr quantity< decltype(_1/U_())> operator/ (quantity< U_ > rhs) const
 Returns the quantity value divided by rhs. More...
 
template<typename U_ >
constexpr quantity< U_ > operator* (U_ rhs) const
 Returns the quantity value multiplied by rhs. More...
 
template<typename U_ >
constexpr quantity< decltype(_1/U_())> operator/ (U_ rhs) const
 Returns the quantity value divided by rhs. More...
 
constexpr operator float64 () const
 Returns a floating-point representation of the quantity value. More...
 
- Public Member Functions inherited from sydevs::quantity_base
constexpr bool valid () const
 Returns true if the quantity value is valid. More...
 
constexpr bool finite () const
 Returns true if the quantity value is finite. More...
 
constexpr int64 multiplier () const
 Returns the number that multiples the length precision. More...
 
constexpr scale precision () const
 Returns the length precision. More...
 
constexpr bool fixed () const
 Returns true if the quantity value has a fixed length precision. More...
 

Static Public Member Functions

static constexpr quantity inf ()
 
static constexpr quantity max (scale precision)
 

Friends

template<typename U_ >
class quantity
 

Additional Inherited Members

- Protected Member Functions inherited from sydevs::quantity_base
constexpr quantity_base ()
 
constexpr quantity_base (int64 multiplier)
 
constexpr quantity_base (int64 multiplier, scale precision)
 
constexpr quantity_base (int64 multiplier, scale precision, bool fixed)
 
constexpr quantity_base (scale precision, float64 multiplier, int8 fixed)
 
constexpr quantity_base (const quantity_base &)=default
 Copy constructor. More...
 
quantity_baseoperator= (const quantity_base &)=default
 Copy assignment. More...
 
 quantity_base (quantity_base &&)=default
 Move constructor. More...
 
quantity_baseoperator= (quantity_base &&)=default
 Move assignment. More...
 
 ~quantity_base ()=default
 Destructor. More...
 
- Static Protected Member Functions inherited from sydevs::quantity_base
static constexpr int64 constexpr_abs (int64 n)
 
static constexpr float64 constexpr_abs (float64 x)
 
static constexpr float64 convert_multiplier (int64 multiplier)
 
static constexpr int64 convert_level (int64 multiplier, int64 level)
 
static constexpr float64 offset_multiplier (float64 multiplier)
 
static constexpr int64 truncate_multiplier (float64 multiplier)
 
static constexpr int64 round_multiplier (float64 multiplier)
 
static constexpr int64 scale_multiplier (float64 multiplier, float64 factor)
 
- Protected Attributes inherited from sydevs::quantity_base
float64 multiplier_
 
scale precision_
 
int8 fixed_
 
- Static Protected Attributes inherited from sydevs::quantity_base
static constexpr float64 inf_float64 = std::numeric_limits<float64>::infinity()
 
static constexpr float64 nan_float64 = std::numeric_limits<float64>::quiet_NaN()
 
static constexpr int64 inf_int64 = std::numeric_limits<int64>::max()
 
static constexpr int64 nan_int64 = std::numeric_limits<int64>::min()
 

Detailed Description

template<>
class sydevs::quantity< no_units >

A speciaulization to facilitate the conversion of dimensionless quantities into floats.

Constructor & Destructor Documentation

constexpr sydevs::quantity< no_units >::quantity ( )
constexpr sydevs::quantity< no_units >::quantity ( int64  multiplier)
explicit
constexpr sydevs::quantity< no_units >::quantity ( int64  multiplier,
scale  precision 
)
constexpr sydevs::quantity< no_units >::quantity ( const quantity< no_units > &  )
default

Copy constructor.

Move constructor.

Destructor.

Member Function Documentation

constexpr const quantity< no_units > sydevs::quantity< no_units >::coarsened ( ) const

Returns a new quantity value with the length precision maximized without losing precision.

constexpr const quantity< no_units > sydevs::quantity< no_units >::fixed_at ( scale  precision) const

Returns a new quantity value with the length precision changed and fixed.

constexpr quantity< no_units > sydevs::quantity< no_units >::inf ( )
static
constexpr quantity< no_units > sydevs::quantity< no_units >::max ( scale  precision)
static
constexpr sydevs::quantity< no_units >::operator float64 ( ) const

Returns a floating-point representation of the quantity value.

constexpr const quantity< no_units > sydevs::quantity< no_units >::operator* ( float64  rhs) const

Returns a new quantity value multiplied by rhs.

template<typename U_ >
constexpr quantity< U_ > sydevs::quantity< no_units >::operator* ( quantity< U_ >  rhs) const

Returns the quantity value multiplied by rhs.

template<typename U_ >
constexpr quantity< U_ > sydevs::quantity< no_units >::operator* ( U_  rhs) const

Returns the quantity value multiplied by rhs.

constexpr const quantity< no_units > sydevs::quantity< no_units >::operator+ ( ) const

Returns a copy of the quantity value.

constexpr const quantity< no_units > sydevs::quantity< no_units >::operator+ ( quantity< no_units rhs) const

Returns a new quantity value with rhs added.

constexpr const quantity< no_units > sydevs::quantity< no_units >::operator- ( ) const

Returns the negation of the quantity value.

constexpr const quantity< no_units > sydevs::quantity< no_units >::operator- ( quantity< no_units rhs) const

Returns a new quantity value with rhs subtracted.

constexpr const quantity< no_units > sydevs::quantity< no_units >::operator/ ( float64  rhs) const

Returns a new quantity value divided by rhs.

template<typename U_ >
constexpr quantity< decltype(_1/U_())> sydevs::quantity< no_units >::operator/ ( quantity< U_ >  rhs) const

Returns the quantity value divided by rhs.

template<typename U_ >
constexpr quantity< decltype(_1/U_())> sydevs::quantity< no_units >::operator/ ( U_  rhs) const

Returns the quantity value divided by rhs.

quantity& sydevs::quantity< no_units >::operator= ( const quantity< no_units > &  )
default

Copy assignment.

quantity& sydevs::quantity< no_units >::operator= ( quantity< no_units > &&  )
default

Move assignment.

constexpr const quantity< no_units > sydevs::quantity< no_units >::refined ( ) const

Returns a new quantity value with the length precision minimized without losing precision.

constexpr const quantity< no_units > sydevs::quantity< no_units >::rescaled ( scale  precision) const

Returns a new quantity value with the length precision changed but neither fixed nor unfixed.

constexpr const quantity< no_units > sydevs::quantity< no_units >::unfixed ( ) const

Returns a new quantity value with the length precision unfixed.

Friends And Related Function Documentation

template<typename U_ >
friend class quantity
friend

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