TRIQS/itertools 1.3.0
C++ range library
Loading...
Searching...
No Matches
utils.hpp File Reference
#include <cstddef>
#include <iterator>
#include <type_traits>
#include <utility>
#include <vector>

Detailed Description

Provides some utility functions for itertools.

Definition in file utils.hpp.

Go to the source code of this file.

Functions

std::pair< std::ptrdiff_t, std::ptrdiff_t > itertools::chunk_range (std::ptrdiff_t first, std::ptrdiff_t last, long n_chunks, long rank)
 Given an integer range [first, last), divide it as equally as possible into N chunks.
 
template<typename Iter1 , typename Iter2 >
std::iterator_traits< Iter1 >::difference_type itertools::distance (Iter1 first, Iter2 last)
 Calculate the distance between two iterators.
 
template<typename R >
auto itertools::make_vector_from_range (R const &rg)
 Create a vector from a range.