STXXL  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
uint_types.h File Reference
#include <stxxl/bits/config.h>
#include <stxxl/bits/namespace.h>
#include <stxxl/bits/common/utils.h>
#include <stxxl/bits/common/types.h>
#include <limits>
#include <ostream>
#include <cassert>

Go to the source code of this file.

Classes

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

Namespaces

 stxxl
 STXXL library namespace
 

Typedefs

typedef HighType high_type
 higher part type, currently either 8-bit or 16-bit More...
 
typedef uint32 low_type
 lower part type, always 32-bit More...
 
typedef uint_pair< uint8 > stxxl::uint40
 Construct a 40-bit unsigned integer stored in five bytes. More...
 
typedef uint_pair< uint16 > stxxl::uint48
 Construct a 48-bit unsigned integer stored in six bytes. More...
 

Functions

template<typename HighType >
class stxxl::uint_pair stxxl::__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 () 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 u64 () const
 return the number as a uint64 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 uint_pair &a)
 copy constructor More...
 
 uint_pair (const uint32 &a)
 const from a simple 32-bit unsigned integer More...
 
 uint_pair (const int32 &a)
 const from a simple 32-bit signed integer More...
 
 uint_pair (const uint64 &a)
 construct from an uint64 (unsigned long long) More...
 
uint64 ull () const
 return the number as an uint64 (unsigned long long) More...
 

Variables

class std::numeric_limits
< stxxl::uint_pair< HighType > > 
std::__attribute__
 
static const int bytes = sizeof(low_type) + sizeof(high_type)
 number of bytes in uint_pair More...
 
static const int 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 int 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 int low_bits = 8 * sizeof(low_type)
 number of bits in the lower integer part, used a bit shift value. More...
 

Typedef Documentation

typedef HighType high_type

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

Definition at line 68 of file uint_types.h.

typedef uint32 low_type

lower part type, always 32-bit

Definition at line 66 of file uint_types.h.

Function Documentation

static high_type __attribute__::high_max ( )
staticprivate

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

Definition at line 86 of file uint_types.h.

Referenced by stxxl::uint_pair< HighType >::operator+=().

static low_type __attribute__::low_max ( )
staticprivate

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

Definition at line 77 of file uint_types.h.

References max().

Referenced by stxxl::uint_pair< HighType >::operator++(), stxxl::uint_pair< HighType >::operator+=(), and stxxl::uint_pair< HighType >::operator--().

static uint_pair __attribute__::min ( )
static

return an uint_pair instance containing the smallest value possible

Examples:
examples/algo/copy_and_sort_file.cpp, examples/algo/phonebills.cpp, examples/algo/phonebills_genlog.cpp, examples/algo/sort_file.cpp, examples/containers/map1.cpp, examples/containers/pqueue2.cpp, examples/containers/sorter1.cpp, and examples/containers/sorter2.cpp.

Definition at line 237 of file uint_types.h.

Referenced by stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::choose_level_for_feedable_sw(), stxxl::block_scheduler< SwappableBlockType >::get_free_internal_block(), std::numeric_limits< stxxl::uint_pair< HighType > >::lowest(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::matrix_col_vector_multiply_and_add_swappable_block(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::matrix_from_vectors_swappable_block(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::matrix_row_vector_multiply_and_add_swappable_block(), stxxl::uint_pair< HighType >::min(), stxxl::tuple< typename Input1_::value_type, typename Input2_::value_type, typename Input3_::value_type, typename Input4_::value_type, typename Input5_::value_type >::min_value(), stxxl::tuple< T1, Plug, Plug, Plug, Plug >::min_value(), stxxl::tuple< T1, T2, Plug, Plug, Plug, Plug >::min_value(), stxxl::tuple< T1, T2, T3, Plug, Plug, Plug >::min_value(), stxxl::tuple< T1, T2, T3, T4, Plug, Plug >::min_value(), stxxl::tuple< T1, T2, T3, T4, T5, Plug >::min_value(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::multi_level_strassen_winograd_multiply_and_add(), and stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::multi_level_strassen_winograd_multiply_and_add_block_grained().

__attribute__::operator uint64 ( ) const
inline

implicit cast to an unsigned long long

Definition at line 154 of file uint_types.h.

bool __attribute__::operator!= ( const uint_pair b) const
inline
uint_pair& __attribute__::operator+= ( const uint_pair b)
inline

addition operator (uses 64-bit arithmetic)

Definition at line 186 of file uint_types.h.

References high, and low.

uint_pair& __attribute__::operator-- ( )
inline
bool __attribute__::operator< ( const uint_pair b) const
inline

less-than comparison operator

Examples:
examples/algo/copy_and_sort_file.cpp, and examples/algo/sort_file.cpp.

Definition at line 207 of file uint_types.h.

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

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

Examples:
examples/algo/copy_and_sort_file.cpp, examples/algo/phonebills.cpp, examples/algo/phonebills_genlog.cpp, and examples/algo/sort_file.cpp.

Definition at line 231 of file uint_types.h.

Referenced by stxxl::buf_ostream< BlockType, BIDIteratorType >::fill().

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

less-or-equal comparison operator

Definition at line 213 of file uint_types.h.

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

greater comparison operator

Definition at line 219 of file uint_types.h.

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

greater-or-equal comparison operator

Definition at line 225 of file uint_types.h.

uint64 __attribute__::u64 ( ) const
inline

return the number as a uint64

Definition at line 160 of file uint_types.h.

__attribute__::uint_pair ( )
inline

empty constructor, does not even initialize to zero!

Definition at line 102 of file uint_types.h.

Referenced by stxxl::uint_pair< HighType >::min().

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

construct unit pair from lower and higher parts.

Definition at line 114 of file uint_types.h.

__attribute__::uint_pair ( const uint_pair &  a)
inline

copy constructor

Definition at line 119 of file uint_types.h.

__attribute__::uint_pair ( const uint32 &  a)
inline

const from a simple 32-bit unsigned integer

Definition at line 124 of file uint_types.h.

__attribute__::uint_pair ( const int32 &  a)
inline

const from a simple 32-bit signed integer

Definition at line 129 of file uint_types.h.

__attribute__::uint_pair ( const uint64 &  a)
inline

construct from an uint64 (unsigned long long)

Definition at line 139 of file uint_types.h.

References high, low, and low_bits.

uint64 __attribute__::ull ( ) const
inline

return the number as an uint64 (unsigned long long)

Definition at line 148 of file uint_types.h.

Referenced by stxxl::uint_pair< HighType >::operator uint64().

Variable Documentation

const int digits = low_bits + high_bits
static

number of binary digits (bits) in uint_pair

Definition at line 96 of file uint_types.h.

const int high_bits = 8 * sizeof(high_type)
static

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

Definition at line 92 of file uint_types.h.

Referenced by stxxl::uint_pair< HighType >::uint_pair().

const int low_bits = 8 * sizeof(low_type)
static

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

Definition at line 83 of file uint_types.h.

Referenced by stxxl::uint_pair< HighType >::operator+=(), stxxl::uint_pair< HighType >::u64(), stxxl::uint_pair< HighType >::uint_pair(), and uint_pair().