INET Framework for OMNeT++/OMNEST
inet::math::internal Namespace Reference

Classes

struct  bits_to_indices_sequence
 
struct  bits_to_indices_sequence< 0b0, 0 >
 
struct  bits_to_indices_sequence< 0b0, 1 >
 
struct  bits_to_indices_sequence< 0b00, 2 >
 
struct  bits_to_indices_sequence< 0b00011, 5 >
 
struct  bits_to_indices_sequence< 0b01, 2 >
 
struct  bits_to_indices_sequence< 0b10, 2 >
 
struct  bits_to_indices_sequence< 0b11000, 5 >
 
struct  bits_to_indices_sequence< 0b11110, 5 >
 

Typedefs

template<int DIMS, int SIZE>
using make_bits_to_indices_sequence = typename bits_to_indices_sequence< DIMS, SIZE >::type
 

Functions

template<typename... T, size_t ... IS>
std::ostream & print (std::ostream &os, const Domain< T ... > &d, std::integer_sequence< size_t, IS... >)
 
template<typename... T, size_t ... IS>
std::ostream & print (std::ostream &os, const Interval< T ... > &i, std::integer_sequence< size_t, IS... >)
 
template<typename S , size_t ... SIS, typename D , size_t ... DIS>
void copyTupleElements (const S &source, std::integer_sequence< size_t, SIS ... >, D &destination, std::integer_sequence< size_t, DIS ... >)
 
template<std::size_t ... NS, typename T , typename... TS>
Point< TS ... > tailImpl (std::index_sequence< NS ... >, const Point< T, TS ... > &p)
 
template<typename... TS1, size_t ... IS1, typename... TS2, size_t ... IS2>
Point< TS1 ..., TS2 ... > concatImpl (const Point< TS1 ... > &p1, std::integer_sequence< size_t, IS1 ... >, const Point< TS2 ... > &p2, std::integer_sequence< size_t, IS2 ... >)
 
template<typename... T, size_t ... IS>
std::ostream & print (std::ostream &os, const Point< T ... > &p, std::integer_sequence< size_t, IS... >)
 

Typedef Documentation

◆ make_bits_to_indices_sequence

template<int DIMS, int SIZE>
using inet::math::internal::make_bits_to_indices_sequence = typedef typename bits_to_indices_sequence<DIMS, SIZE>::type

Function Documentation

◆ concatImpl()

template<typename... TS1, size_t ... IS1, typename... TS2, size_t ... IS2>
Point<TS1 ..., TS2 ...> inet::math::internal::concatImpl ( const Point< TS1 ... > &  p1,
std::integer_sequence< size_t, IS1 ... >  ,
const Point< TS2 ... > &  p2,
std::integer_sequence< size_t, IS2 ... >   
)
inline
208  {
209  return Point<TS1 ..., TS2 ...>{ (std::get<IS1>(p1)) ..., (std::get<IS2>(p2)) ... };
210 }

Referenced by inet::math::concat().

◆ copyTupleElements()

template<typename S , size_t ... SIS, typename D , size_t ... DIS>
void inet::math::internal::copyTupleElements ( const S source,
std::integer_sequence< size_t, SIS ... >  ,
D &  destination,
std::integer_sequence< size_t, DIS ... >   
)
83  {
84  (void)std::initializer_list<double>{ toDouble(std::get<DIS>(destination) = std::get<SIS>(source)) ... };
85 }

Referenced by inet::math::Point< T ... >::copyFrom(), and inet::math::Point< T ... >::copyTo().

◆ print() [1/3]

template<typename... T, size_t ... IS>
std::ostream& inet::math::internal::print ( std::ostream &  os,
const Domain< T ... > &  d,
std::integer_sequence< size_t, IS... >   
)
inline
34  {
35  (void)std::initializer_list<bool>{ (os << (IS == 0 ? "" : ", "), printUnit(os, T()), true) ... };
36  return os;
37 }

Referenced by inet::math::operator<<(), inet::math::FunctionBase< R, Domain< X > >::print(), inet::math::FunctionBase< R, Domain< X > >::printOn(), inet::RsvpTe::processPathMsg(), and inet::RsvpTe::processResvMsg().

◆ print() [2/3]

template<typename... T, size_t ... IS>
std::ostream& inet::math::internal::print ( std::ostream &  os,
const Interval< T ... > &  i,
std::integer_sequence< size_t, IS... >   
)
inline
202  {
203  const auto& lower = i.getLower();
204  const auto& upper = i.getUpper();
205  auto lowerClosed = i.getLowerClosed();
206  (void)lowerClosed;
207  auto upperClosed = i.getUpperClosed();
208  (void)upperClosed;
209  auto fixed = i.getFixed();
210  (void)fixed;
211  unsigned char b = 1 << std::tuple_size<std::tuple<T ...>>::value >> 1;
212  (void)std::initializer_list<bool>{(os << (IS == 0 ? "" : " x "), (std::get<IS>(lower) == std::get<IS>(upper) ?
213  (fixed & (b >> IS) ? os << std::get<IS>(lower) : os << "[" << std::get<IS>(lower) << "]") :
214  os << ((lowerClosed & (b >> IS)) ? "[" : "(") << std::get<IS>(lower) << " … " << std::get<IS>(upper) << ((upperClosed & (b >> IS)) ? "]" : ")"), true)) ... };
215  return os;
216 }

◆ print() [3/3]

template<typename... T, size_t ... IS>
std::ostream& inet::math::internal::print ( std::ostream &  os,
const Point< T ... > &  p,
std::integer_sequence< size_t, IS... >   
)
inline
213  {
214  (void)std::initializer_list<bool>{ (os << (IS == 0 ? "" : ", ") << std::get<IS>(p), true) ... };
215  return os;
216 }

◆ tailImpl()

template<std::size_t ... NS, typename T , typename... TS>
Point<TS ...> inet::math::internal::tailImpl ( std::index_sequence< NS ... >  ,
const Point< T, TS ... > &  p 
)
inline
203  {
204  return Point<TS ...>(std::get<NS + 1u>(p) ...);
205 }

Referenced by inet::math::tail().

inet::math::toDouble
double toDouble(const simtime_t v)
Definition: Point.h:34
inet::units::units::T
compose< Wb, pow< m, -2 > > T
Definition: Units.h:951
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
inet::math::printUnit
void printUnit(std::ostream &os, T v)
Definition: Point.h:19