Classes | Namespaces | Typedefs | Functions | Variables
intervals.h File Reference

Defines point and interval variables based on quantities. More...

#include "lardataalg/Utilities/quantities.h"
#include <ostream>
#include <type_traits>

Go to the source code of this file.

Classes

struct  util::quantities::concepts::details::category_of_type< Cat, typename >
 
struct  util::quantities::concepts::details::WithCategory< Cat >
 An object belonging to a category Cat. More...
 
struct  util::quantities::concepts::CategoryBase
 An non-mandatory base class for interval and point categories. More...
 
struct  util::quantities::concepts::is_interval< typename >
 Trait: true_type if IV is a Interval specialization. More...
 
struct  util::quantities::concepts::is_point< typename >
 Trait: true_type if PT is a Point specialization. More...
 
struct  util::quantities::concepts::Interval< Q, Cat >
 An interval (duration, length, distance) between two quantity points. More...
 
struct  util::quantities::concepts::Point< Q, Cat, IV >
 A quantity point. More...
 
struct  util::quantities::NoCategory
 
struct  util::quantities::concepts::details::has_category< typename, typename >
 
struct  util::quantities::concepts::details::has_category< Obj, std::void_t< typename Obj::category_t > >
 
struct  util::quantities::concepts::details::category_has_name< typename, typename >
 
struct  util::quantities::concepts::details::category_has_name< Cat, std::void_t< decltype(Cat::name())> >
 
struct  util::quantities::concepts::details::category_traits< Cat >
 
struct  util::quantities::concepts::details::category_of_type< Cat, typename >
 
struct  util::quantities::concepts::details::category_of_type< Cat, std::void_t< typename Cat::category_t > >
 
struct  util::quantities::concepts::details::WithCategory< Cat >
 An object belonging to a category Cat. More...
 
struct  util::quantities::concepts::is_interval< typename >
 Trait: true_type if IV is a Interval specialization. More...
 
struct  util::quantities::concepts::is_interval< Interval< Args... > >
 
struct  util::quantities::concepts::is_point< typename >
 Trait: true_type if PT is a Point specialization. More...
 
struct  util::quantities::concepts::is_point< Point< Args... > >
 
struct  std::hash< util::quantities::concepts::Interval< Q, Cat > >
 Hash function of a interval or point is delegated to its quantity. More...
 
struct  std::hash< util::quantities::concepts::Point< Q, Cat, IV > >
 
class  std::numeric_limits< util::quantities::concepts::Interval< Q, Cat > >
 
class  std::numeric_limits< util::quantities::concepts::Interval< Q, Cat > const >
 
class  std::numeric_limits< util::quantities::concepts::Interval< Q, Cat > volatile >
 
class  std::numeric_limits < util::quantities::concepts::Interval< Q, Cat > const volatile >
 
class  std::numeric_limits< util::quantities::concepts::Point< Q, Cat, IV > >
 
class  std::numeric_limits< util::quantities::concepts::Point< Q, Cat, IV > const >
 
class  std::numeric_limits< util::quantities::concepts::Point< Q, Cat, IV > volatile >
 
class  std::numeric_limits < util::quantities::concepts::Point< Q, Cat, IV > const volatile >
 

Namespaces

 util::quantities
 Types of variables with a unit.
 
 util::quantities::concepts
 Infrastructure for the quantities library.
 
 util::quantities::concepts::details
 

Typedefs

template<typename Cat >
using util::quantities::concepts::details::category_of = typename category_of_type< Cat >::type
 
template<typename T >
using util::quantities::concepts::is_interval_or_point = std::disjunction< is_interval< T >, is_point< T >>
 Trait: true_type if PT is a specialization of Interval or Point. More...
 
template<typename T >
using util::quantities::concepts::interval_of = typename T::interval_t
 Type of interval contained in specified type T. More...
 
template<typename IV , typename R , typename T = typename IV::value_t>
using util::quantities::concepts::rescale_interval = Interval< rescale< typename IV::quantity_t, R, T >, typename IV::category_t >
 Type of an interval like IV, but with a different unit scale R. More...
 
template<typename PT , typename R , typename T = typename PT::value_t>
using util::quantities::concepts::rescale_point = Point< rescale< typename PT::quantity_t, R, T >, typename PT::category_t >
 Type of a point like PT, but with a different unit scale R. More...
 

Functions

template<typename... Args>
std::ostream & util::quantities::concepts::operator<< (std::ostream &out, Interval< Args... > const iv)
 
template<typename AQ , typename AC , typename BQ , typename BC >
constexpr auto util::quantities::concepts::operator* (Interval< AQ, AC > const, Interval< BQ, BC > const)=delete
 Multiplication between quantities is forbidden. More...
 
template<typename Q , typename Cat , typename T >
constexpr std::enable_if_t< std::is_arithmetic_v< T >, Interval< Q, Cat > > util::quantities::concepts::operator/ (Interval< Q, Cat > const iv, T const quot)
 
template<typename Q , typename Cat >
std::string util::quantities::concepts::to_string (Interval< Q, Cat > const &iv)
 
template<typename... Args>
std::ostream & util::quantities::concepts::operator<< (std::ostream &out, Point< Args... > const p)
 
template<typename Q , typename Cat , typename IV >
std::string util::quantities::concepts::to_string (Point< Q, Cat, IV > const &p)
 
Comparison operations on `Interval`

These operations, as well as the ones implemented as member functions, are provided for convenience.

Here the symmetric operations are defined, where different operands can be swapped.

template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator== (Interval< Q, Cat > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator== (Quantity< Args... > const a, Interval< Q, Cat > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator!= (Interval< Q, Cat > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator!= (Quantity< Args... > const a, Interval< Q, Cat > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator<= (Interval< Q, Cat > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator<= (Quantity< Args... > const a, Interval< Q, Cat > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator< (Interval< Q, Cat > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator< (Quantity< Args... > const a, Interval< Q, Cat > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator>= (Interval< Q, Cat > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator>= (Quantity< Args... > const a, Interval< Q, Cat > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator> (Interval< Q, Cat > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename... Args>
constexpr bool util::quantities::concepts::operator> (Quantity< Args... > const a, Interval< Q, Cat > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator== (Point< Q, Cat, IV > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator== (Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator!= (Point< Q, Cat, IV > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator!= (Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator<= (Point< Q, Cat, IV > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator<= (Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator< (Point< Q, Cat, IV > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator< (Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator>= (Point< Q, Cat, IV > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator>= (Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator> (Point< Q, Cat, IV > const a, Quantity< Args... > const b) noexcept
 
template<typename Q , typename Cat , typename IV , typename... Args>
constexpr bool util::quantities::concepts::operator> (Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
 
Arithmetic operations on `Quantity`

These operations, as well as the ones implemented as member functions, are provided for convenience.

Here the symmetric operations are defined, where different operands can be swapped.

template<typename Q , typename Cat , typename T >
constexpr std::enable_if_t< std::is_arithmetic_v< T >, Interval< Q, Cat > > util::quantities::concepts::operator* (Interval< Q, Cat > const iv, T const factor)
 Multiplication with a scalar. More...
 
template<typename Q , typename Cat , typename T >
constexpr std::enable_if_t< std::is_arithmetic_v< T >, Interval< Q, Cat > > util::quantities::concepts::operator* (T const factor, Interval< Q, Cat > const iv)
 
template<typename Q , typename Cat , typename IV , typename OQ , typename OC >
constexpr Point< Q, Cat, IV > util::quantities::concepts::operator+ (Interval< OQ, OC > const delta, Point< Q, Cat, IV > const p)=delete
 
template<typename Q , typename Cat , typename IV , typename OQ , typename OC >
constexpr Point< Q, Cat, IV > util::quantities::concepts::operator- (Interval< OQ, OC > const delta, Point< Q, Cat, IV > const p)=delete
 
template<typename Q , typename Cat , typename IV , typename OQ , typename OCat >
constexpr Point< Q, Cat, IV >::template enable_if_compatible_t< Point< OQ, OCat, IV >, IV > util::quantities::concepts::operator- (Point< Q, Cat, IV > const a, Point< OQ, OCat, IV > const b)
 
template<typename IV >
IV util::quantities::makeInterval (std::string_view s, bool unitOptional=false)
 Returns an interval of the specified type parsed from a string. More...
 
template<typename IV >
IV util::quantities::makeInterval (std::string const &s, bool unitOptional=false)
 
template<typename IV >
IV util::quantities::makeInterval (char const *s, bool unitOptional=false)
 
template<typename PT >
PT util::quantities::makePoint (std::string_view s, bool unitOptional=false)
 Returns a point of the specified type parsed from a string. More...
 
template<typename PT >
PT util::quantities::makePoint (std::string const &s, bool unitOptional=false)
 
template<typename PT >
PT util::quantities::makePoint (char const *s, bool unitOptional=false)
 

Variables

template<typename IV >
constexpr bool util::quantities::concepts::is_interval_v = is_interval<IV>()
 Trait: true if IV is a Interval specialization. More...
 
template<typename PT >
constexpr bool util::quantities::concepts::is_point_v = is_point<PT>()
 Trait: true if PT is a Point specialization. More...
 
template<typename T >
constexpr bool util::quantities::concepts::is_interval_or_point_v = is_interval_or_point<T>()
 Trait: true if PT is a specialization of Interval or Point. More...
 
template<typename Obj >
constexpr bool util::quantities::concepts::details::has_category_v = has_category<Obj>()
 

Detailed Description

Defines point and interval variables based on quantities.

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.slac..nosp@m.stan.nosp@m.ford..nosp@m.edu)
Date
May 29, 2019
See also
lardataalg/Utilities/quantites.h

Definition in file intervals.h.