MPQC  3.0.0-alpha
mpqc.Math.Range

Classes

struct  mpqc::range::tie< Tuple >
 boost::tuple tie wrapper More...
 
struct  mpqc::range
 

Macros

#define MPQC_RANGE_CONST_OPERATOR(Z, N, DATA)
 
#define MPQC_RANGE_OPERATOR(Z, N, DATA)
 
#define MPQC_RANGE_OPERATORS(N, Type, Function)   BOOST_PP_REPEAT_FROM_TO(1, N, MPQC_RANGE_OPERATOR, (Type, Function))
 Generates operators()(const R1 r1, ...) of arity 1 to N. More...
 
#define MPQC_RANGE_CONST_OPERATORS(N, Type, Function)   BOOST_PP_REPEAT_FROM_TO(1, N, MPQC_RANGE_CONST_OPERATOR, (Type, Function))
 Generates const version of MPQC_RANGE_OPERATORS.
 

Functions

std::ostream & mpqc::operator<< (std::ostream &os, const range &r)
 print range as "begin:end"
 
bool mpqc::operator== (const range &a, const range &b)
 
range mpqc::intersection (const range &a, const range &b)
 
range mpqc::operator& (const range &a, const range &b)
 Range intersection.
 
std::vector< rangempqc::partition (const range &R, size_t N)
 Partition range into N blocks.
 
std::vector< rangempqc::split (range r, size_t N)
 Split range into blocks of size N.
 
std::vector< rangempqc::balanced_split (const range &r, size_t N)
 Split range into roughly equal blocks of size N or less.
 
std::ostream & mpqc::operator<< (std::ostream &os, const std::vector< range > &r)
 print range vector as "[ begin:end, ... ]"
 
range mpqc::range_cast (const range &r)
 Cast range to range, return argument unchanged.
 
template<class R >
boost::enable_if< boost::is_integral< R >, range >::type mpqc::range_cast (const R &r)
 Cast integral argument r to range [r:r+1)
 

Detailed Description

Range objects for iterating or accessing slices of data.


Macro Definition Documentation

◆ MPQC_RANGE_CONST_OPERATOR

#define MPQC_RANGE_CONST_OPERATOR (   Z,
  N,
  DATA 
)
Value:
template<BOOST_PP_ENUM_PARAMS(N, class _R)> \
BOOST_PP_TUPLE_ELEM(2, 0, DATA) \
operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, const _R, &r)) const { \
return BOOST_PP_TUPLE_ELEM(2, 1, DATA) \
(mpqc::detail::range_tie \
(boost::tie(BOOST_PP_ENUM_PARAMS(N, r)))); \
}

◆ MPQC_RANGE_OPERATOR

#define MPQC_RANGE_OPERATOR (   Z,
  N,
  DATA 
)
Value:
template<BOOST_PP_ENUM_PARAMS(N, class _R)> \
BOOST_PP_TUPLE_ELEM(2, 0, DATA) \
operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, const _R, &r)) { \
return BOOST_PP_TUPLE_ELEM(2, 1, DATA) \
(mpqc::detail::range_tie \
(boost::tie(BOOST_PP_ENUM_PARAMS(N, r)))); \
}

◆ MPQC_RANGE_OPERATORS

#define MPQC_RANGE_OPERATORS (   N,
  Type,
  Function 
)    BOOST_PP_REPEAT_FROM_TO(1, N, MPQC_RANGE_OPERATOR, (Type, Function))

Generates operators()(const R1 r1, ...) of arity 1 to N.

The parameters R are packed into mpqc::range::tie and passed to Function

Parameters
NMaximum operator arity
TypeOperator return type
FunctionFunction that accepts mpqc::range::tie and returns Type

Generated at Sun Jan 26 2020 23:24:02 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.