Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
uint_types.hpp File Reference
#include <cassert>
#include <limits>
#include <ostream>
#include <foxxll/common/types.hpp>
#include <foxxll/common/utils.hpp>
#include <foxxll/config.hpp>
+ Include dependency graph for uint_types.hpp:

Go to the source code of this file.

Classes

class  uint_pair< HighType >
 Construct an 40-bit or 48-bit unsigned integer stored in five or six bytes. More...
 
class  numeric_limits< foxxll::uint_pair< HighType > >
 template class providing some numeric_limits fields for uint_pair types. More...
 

Namespaces

 foxxll
 FOXXLL library namespace
 

Typedefs

using high_type = HighType
 higher part type, currently either 8-bit or 16-bit More...
 
using low_type = uint32_t
 lower part type, always 32-bit More...
 
using uint40 = uint_pair< uint8_t >
 Construct a 40-bit unsigned integer stored in five bytes. More...
 
using uint48 = uint_pair< uint16_t >
 Construct a 48-bit unsigned integer stored in six bytes. More...
 

Functions

template<typename HighType >
class foxxll::uint_pair __attribute__ ((packed))
 
static high_type high_max ()
 return highest value storable in higher part, also used as a mask. More...
 
static low_type low_max ()
 return highest value storable in lower part, also used as a mask. More...
 
static uint_pair max ()
 return an uint_pair instance containing the largest value possible More...
 
static uint_pair min ()
 return an uint_pair instance containing the smallest value possible More...
 
 operator uint64_t () const
 implicit cast to an unsigned long long More...
 
bool operator!= (const uint_pair &b) const
 inequality checking operator More...
 
uint_pairoperator++ ()
 prefix increment operator (directly manipulates the integer parts) More...
 
uint_pairoperator+= (const uint_pair &b)
 addition operator (uses 64-bit arithmetic) More...
 
uint_pairoperator-- ()
 prefix decrement operator (directly manipulates the integer parts) More...
 
bool operator< (const uint_pair &b) const
 less-than comparison operator More...
 
std::ostream & operator<< (std::ostream &os, const uint_pair &a)
 make a uint_pair outputtable via iostreams, using unsigned long long. More...
 
bool operator<= (const uint_pair &b) const
 less-or-equal comparison operator More...
 
bool operator== (const uint_pair &b) const
 equality checking operator More...
 
bool operator> (const uint_pair &b) const
 greater comparison operator More...
 
bool operator>= (const uint_pair &b) const
 greater-or-equal comparison operator More...
 
uint64_t u64 () const
 return the number as a uint64_t More...
 
 uint_pair ()
 empty constructor, does not even initialize to zero! More...
 
 uint_pair (const low_type &l, const high_type &h)
 construct unit pair from lower and higher parts. More...
 
 uint_pair (const uint32_t &a)
 implicit conversion from a simple 32-bit unsigned integer More...
 
 uint_pair (const int32_t &a)
 implicit conversion from a simple 32-bit signed integer More...
 
 uint_pair (const uint64_t &a)
 implicit conversion from an uint64_t (unsigned long long) More...
 
uint64_t ull () const
 return the number as an uint64_t (unsigned long long) More...
 

Variables

class std::numeric_limits
< foxxll::uint_pair< HighType > > 
__attribute__
 
static const size_t bytes = sizeof(low_type) + sizeof(high_type)
 number of bytes in uint_pair More...
 
static const size_t digits = low_bits + high_bits
 number of binary digits (bits) in uint_pair More...
 
high_type high
 member containing higher significant integer value More...
 
static const size_t high_bits = 8 * sizeof(high_type)
 number of bits in the higher integer part, used a bit shift value. More...
 
low_type low
 member containing lower significant integer value More...
 
static const size_t low_bits = 8 * sizeof(low_type)
 number of bits in the lower integer part, used a bit shift value. More...
 

Typedef Documentation

using high_type = HighType

higher part type, currently either 8-bit or 16-bit

Definition at line 44 of file uint_types.hpp.

using low_type = uint32_t

lower part type, always 32-bit

Definition at line 42 of file uint_types.hpp.

Function Documentation

static high_type __attribute__::high_max ( )
staticprivate

return highest value storable in higher part, also used as a mask.

Definition at line 62 of file uint_types.hpp.

static low_type __attribute__::low_max ( )
staticprivate

return highest value storable in lower part, also used as a mask.

Definition at line 53 of file uint_types.hpp.

static uint_pair __attribute__::max ( )
static

return an uint_pair instance containing the largest value possible

Definition at line 226 of file uint_types.hpp.

Referenced by Aggregate< Type_ >::Add(), Manager::add(), BlockPool::AllocateByteBlock(), buf_istream< BlockType, BidIteratorType >::buf_istream(), buf_istream_reverse< BlockType, BidIteratorType >::buf_istream_reverse(), CmdlineParser::calc_option_max(), CmdlineParser::calc_param_max(), ReservoirSamplingGrow< SampleIndexPair >::calc_sample_size(), memory_file::discard(), LocationDetection< thrill::api::JoinNode::HashCount >::Flush(), MixStreamData::GetWriters(), CatStreamData::GetWriters(), UIntPair< High_ >::high_max(), Range::Invalid(), StochasticGradientDescent< Vector >::is_converged(), UIntPair< High_ >::low_max(), main(), BlockPool::MapExternalBlock(), uint_pair< HighType >::max(), UIntPair< High_ >::max(), numeric_limits< thrill::common::UIntPair< HighType > >::max(), new_alloc< Type >::max_size(), Pool::max_size(), HyperLogLogRegisters< p >::mergeDense(), Multiplexer::Multiplexer(), tlx::multisequence_partition(), tlx::multisequence_selection(), block_manager::new_blocks(), Aggregate< Type_ >::operator+(), Aggregate< Type_ >::operator+=(), OutputSVG(), examples::select::PickPivots(), examples::suffix_sorting::PrefixDoublingDiscarding(), examples::suffix_sorting::PrefixDoublingSorting(), examples::suffix_sorting::PrefixDoublingWindow(), examples::suffix_sorting::PrefixQuadrupling(), CmdlineParser::print_result(), Context::PrintCollectiveMeanStdev(), block_scheduler_algorithm_offline_lfd< SwappableBlockType >::priority::priority(), ReadBinaryNode< ValueType >::ReadBinaryNode(), hypergeometric_distribution<>::rk_hypergeometric_hrua(), RunJoinPageRankEdgePerLine(), RunPageRankEdgePerLine(), syscall_file::serve(), StatsCounter< ValueType_, true >::set_max(), memory_file::set_size(), Select::SetException(), Select::SetRead(), Select::SetWrite(), ReduceBucketHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig, IndexFunction, KeyEqualFunction >::SpillSmallestPartition(), stats_data::summary< T >::summary(), Connection::SyncRecv(), Connection::SyncSend(), Connection::SyncSendRecv(), and HyperLogLogRegisters< p >::toDense().

static uint_pair __attribute__::min ( )
static

return an uint_pair instance containing the smallest value possible

Definition at line 217 of file uint_types.hpp.

Referenced by Aggregate< Type_ >::Add(), Group::AllGatherBruck(), UnionNode< ValueType >::consume_counter(), ZipNode< ValueType, ZipFunction, Pad, UnequalCheck, NoRebalance, kNumInputs >::DoScatter(), ZipWindowNode< ValueType, ZipFunction_, Pad_, UnequalCheck, UseStdArray, kNumInputs_ >::DoScatter(), OverlapWindowNode< ValueType, Input, WindowFunction, PartialWindowFunction >::Execute(), ConcatNode< ValueType >::Execute(), DisjointWindowNode< ValueType, Input, WindowFunction, PartialWindowFunction >::Execute(), block_scheduler< SwappableBlockType >::get_free_internal_block(), ReduceProbingHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >::GrowPartition(), ReduceProbingHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >::Initialize(), Range::Invalid(), numeric_limits< foxxll::uint_pair< HighType > >::lowest(), numeric_limits< thrill::common::UIntPair< HighType > >::lowest(), uint_pair< HighType >::min(), UIntPair< High_ >::min(), numeric_limits< thrill::common::UIntPair< HighType > >::min(), tlx::sort_strings_detail::multikey_quicksort(), tlx::multisequence_partition(), tlx::multisequence_selection(), tlx::multiway_merge_detail::multiway_merge_3_combined(), tlx::multiway_merge_detail::multiway_merge_4_combined(), tlx::multiway_merge_detail::multiway_merge_loser_tree_combined(), tlx::multiway_merge_detail::multiway_merge_loser_tree_unguarded(), ReadBinaryNode< ValueType >::VfsFileBlockSource::NextBlock(), ComponentSum< std::vector< Type >, Operation >::operator()(), Aggregate< Type_ >::operator+(), Aggregate< Type_ >::operator+=(), OutputSVG(), tlx::parallel_multiway_merge_base(), examples::select::PickPivots(), FlowControlChannel::Predecessor(), tlx::multiway_merge_detail::prepare_unguarded(), Context::PrintCollectiveMeanStdev(), SHA1::process(), SHA256::process(), SHA512::process(), MD5::process(), ReadBinaryNode< ValueType >::ReadBinaryNode(), SimpleVector< std::thread >::resize(), hypergeometric_distribution<>::rk_hypergeometric_hrua(), hypergeometric_distribution<>::rk_hypergeometric_hyp(), and stats_data::summary< T >::summary().

__attribute__::operator uint64_t ( ) const

implicit cast to an unsigned long long

Definition at line 134 of file uint_types.hpp.

References uint_pair< HighType >::high_bits, and uint_pair< HighType >::low_bits.

bool __attribute__::operator!= ( const uint_pair b) const

inequality checking operator

Definition at line 181 of file uint_types.hpp.

uint_pair& __attribute__::operator++ ( )

prefix increment operator (directly manipulates the integer parts)

Definition at line 146 of file uint_types.hpp.

uint_pair& __attribute__::operator+= ( const uint_pair b)

addition operator (uses 64-bit arithmetic)

Definition at line 166 of file uint_types.hpp.

uint_pair& __attribute__::operator-- ( )

prefix decrement operator (directly manipulates the integer parts)

Definition at line 156 of file uint_types.hpp.

bool __attribute__::operator< ( const uint_pair b) const

less-than comparison operator

Definition at line 187 of file uint_types.hpp.

friend std::ostream& __attribute__::operator<< ( std::ostream &  os,
const uint_pair a 
)

make a uint_pair outputtable via iostreams, using unsigned long long.

Definition at line 211 of file uint_types.hpp.

bool __attribute__::operator<= ( const uint_pair b) const

less-or-equal comparison operator

Definition at line 193 of file uint_types.hpp.

bool __attribute__::operator== ( const uint_pair b) const

equality checking operator

Definition at line 175 of file uint_types.hpp.

Referenced by Delegate< R(A...), Allocator >::operator!=().

bool __attribute__::operator> ( const uint_pair b) const

greater comparison operator

Definition at line 199 of file uint_types.hpp.

bool __attribute__::operator>= ( const uint_pair b) const

greater-or-equal comparison operator

Definition at line 205 of file uint_types.hpp.

uint64_t __attribute__::u64 ( ) const

return the number as a uint64_t

Definition at line 140 of file uint_types.hpp.

__attribute__::uint_pair ( )

empty constructor, does not even initialize to zero!

Definition at line 78 of file uint_types.hpp.

__attribute__::uint_pair ( const low_type l,
const high_type h 
)

construct unit pair from lower and higher parts.

Definition at line 99 of file uint_types.hpp.

__attribute__::uint_pair ( const uint32_t &  a)

implicit conversion from a simple 32-bit unsigned integer

Definition at line 104 of file uint_types.hpp.

__attribute__::uint_pair ( const int32_t &  a)

implicit conversion from a simple 32-bit signed integer

Definition at line 109 of file uint_types.hpp.

__attribute__::uint_pair ( const uint64_t &  a)

implicit conversion from an uint64_t (unsigned long long)

Definition at line 119 of file uint_types.hpp.

uint64_t __attribute__::ull ( ) const

return the number as an uint64_t (unsigned long long)

Definition at line 128 of file uint_types.hpp.

Referenced by thrill::common::Hash128to64(), and tlx::siphash_plain().

Variable Documentation

const size_t digits = low_bits + high_bits
static

number of binary digits (bits) in uint_pair

Definition at line 72 of file uint_types.hpp.

high_type high

member containing higher significant integer value

Definition at line 50 of file uint_types.hpp.

const size_t high_bits = 8 * sizeof(high_type)
static

number of bits in the higher integer part, used a bit shift value.

Definition at line 68 of file uint_types.hpp.

low_type low

member containing lower significant integer value

Definition at line 48 of file uint_types.hpp.

const size_t low_bits = 8 * sizeof(low_type)
static

number of bits in the lower integer part, used a bit shift value.

Definition at line 59 of file uint_types.hpp.