OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Intervals< T > Class Template Reference

#include <Intervals.h>

Classes

class  Iterator
 

Public Member Functions

Iterator begin ()
 
Iterator end ()
 

Private Types

using Unsigned = typename std::make_unsigned< T >::type
 

Private Member Functions

 Intervals (T begin, T end, Unsigned n_workers)
 

Private Attributes

T const begin_
 
Unsigned const total_size_
 
Unsigned const quot_
 
Unsigned const rem_
 

Friends

template<typename U >
Intervals< U > makeIntervals (U begin, U end, std::size_t n_workers)
 

Detailed Description

template<typename T>
class Intervals< T >

Definition at line 71 of file Intervals.h.

Member Typedef Documentation

template<typename T>
using Intervals< T >::Unsigned = typename std::make_unsigned<T>::type
private

Definition at line 72 of file Intervals.h.

Constructor & Destructor Documentation

template<typename T>
Intervals< T >::Intervals ( begin,
end,
Unsigned  n_workers 
)
inlineprivate

Definition at line 78 of file Intervals.h.

79  : begin_(begin)
80  , total_size_(begin < end && n_workers ? end - begin : 0)
81  , quot_(n_workers ? total_size_ / n_workers : 0)
82  , rem_(n_workers ? total_size_ % n_workers : 0) {
83  static_assert(std::is_integral_v<T>);
84  }
Unsigned const quot_
Definition: Intervals.h:75
Unsigned const total_size_
Definition: Intervals.h:74
Iterator begin()
Definition: Intervals.h:101
Unsigned const rem_
Definition: Intervals.h:76
Iterator end()
Definition: Intervals.h:102
T const begin_
Definition: Intervals.h:73

Member Function Documentation

template<typename T>
Iterator Intervals< T >::begin ( )
inline

Definition at line 101 of file Intervals.h.

References Intervals< T >::begin_, Intervals< T >::quot_, and Intervals< T >::rem_.

Referenced by Intervals< T >::end(), and makeIntervals().

101 { return {begin_, quot_, rem_}; }
Unsigned const quot_
Definition: Intervals.h:75
Unsigned const rem_
Definition: Intervals.h:76
T const begin_
Definition: Intervals.h:73

+ Here is the caller graph for this function:

template<typename T>
Iterator Intervals< T >::end ( )
inline

Definition at line 102 of file Intervals.h.

References Intervals< T >::begin(), Intervals< T >::begin_, Intervals< T >::makeIntervals, Intervals< T >::quot_, omnisci.dtypes::T, and Intervals< T >::total_size_.

Referenced by makeIntervals().

102 { return {static_cast<T>(begin_ + total_size_), quot_, 0}; }
Unsigned const quot_
Definition: Intervals.h:75
Unsigned const total_size_
Definition: Intervals.h:74
T const begin_
Definition: Intervals.h:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Friends And Related Function Documentation

template<typename T>
template<typename U >
Intervals<U> makeIntervals ( begin,
end,
std::size_t  n_workers 
)
friend

Referenced by Intervals< T >::end().

Member Data Documentation

template<typename T>
T const Intervals< T >::begin_
private

Definition at line 73 of file Intervals.h.

Referenced by Intervals< T >::begin(), and Intervals< T >::end().

template<typename T>
Unsigned const Intervals< T >::quot_
private

Definition at line 75 of file Intervals.h.

Referenced by Intervals< T >::begin(), and Intervals< T >::end().

template<typename T>
Unsigned const Intervals< T >::rem_
private

Definition at line 76 of file Intervals.h.

Referenced by Intervals< T >::begin().

template<typename T>
Unsigned const Intervals< T >::total_size_
private

Definition at line 74 of file Intervals.h.

Referenced by Intervals< T >::end().


The documentation for this class was generated from the following file: