|
| #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.
|
| |
|
|
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< range > | mpqc::partition (const range &R, size_t N) |
| | Partition range into N blocks.
|
| |
|
std::vector< range > | mpqc::split (range r, size_t N) |
| | Split range into blocks of size N.
|
| |
|
std::vector< range > | mpqc::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)
|
| |
Range objects for iterating or accessing slices of data.
◆ 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
-
| N | Maximum operator arity |
| Type | Operator return type |
| Function | Function that accepts mpqc::range::tie and returns Type |