32#ifndef MADNESS_WORLD_RANGE_H__INCLUDED
33#define MADNESS_WORLD_RANGE_H__INCLUDED
38# include <tbb/partitioner.h>
63 template <
typename iteratorT>
110 int nleft = (left.n+1)/2;
113 advance(start,nleft);
114 finish = left.finish;
162 template<
typename integralT,
typename distanceT>
163 inline static typename std::enable_if<std::is_integral<integralT>::value,
void>
::type
173 template<
typename iterT,
typename distanceT>
174 inline static typename std::enable_if<!std::is_integral<iterT>::value,
void>
::type
184 template<
class integralT>
185 inline static typename std::enable_if<std::is_integral<integralT>::value, integralT>
::type
186 distance(integralT first, integralT last) {
return last - first; }
195 template<
class iterT>
198 typename std::enable_if<!std::is_integral<iterT>::value>
::type* =
nullptr)
Range(Range &left, const Split &)
Splits range between new and old (r) objects. Cost is O(1).
Definition range.h:103
static std::enable_if< std::is_integral< integralT >::value, integralT >::type distance(integralT first, integralT last)
Definition range.h:186
unsigned int get_chunksize() const
Access the chunk size.
Definition range.h:152
bool is_divisible() const
Return true if this iteration range can be divided; that is, there are more items than the chunk size...
Definition range.h:146
static auto distance(iterT first, iterT last, typename std::enable_if<!std::is_integral< iterT >::value >::type *=nullptr) -> decltype(std::distance(first, last))
Calculate the distance between two iterators.
Definition range.h:197
long n
Definition range.h:65
const iterator & end() const
Access the end.
Definition range.h:140
typename dcT::const_iterator iterator
Definition range.h:71
static std::enable_if<!std::is_integral< iterT >::value, void >::type advance(iterT &it, distanceT n)
Advance by n elements in the range.
Definition range.h:175
bool empty() const
Returns true if size == 0.
Definition range.h:130
int chunksize
Definition range.h:68
Range(const iterator &start, const iterator &finish, int chunk=1)
Makes the range [start, finish).
Definition range.h:80
static std::enable_if< std::is_integral< integralT >::value, void >::type advance(integralT &i, distanceT n)
Advance by n elements in the range.
Definition range.h:164
typename dcT::const_iterator finish
Definition range.h:67
const iterator & begin() const
Access the beginning.
Definition range.h:135
typename dcT::const_iterator start
Definition range.h:66
size_t size() const
Returns the number of items in the range (cost is O(1)).
Definition range.h:125
Range(const Range &r)
Copy constructor. Cost is O(1).
Definition range.h:93
tbb::split Split
Dummy class, a la Intel TBB, used to distinguish splitting constructor.
Definition range.h:54
Namespace for all elements and tools of MADNESS.
Definition DFConvergence.h:9
void advance(madness::Hash_private::HashIterator< hashT > &it, const distT &dist)
Definition worldhashmap.h:610
int distance(const madness::Hash_private::HashIterator< hashT > &it, const madness::Hash_private::HashIterator< hashT > &jt)
Definition worldhashmap.h:616