15 #ifndef STXXL_ALGO_ADAPTOR_HEADER
16 #define STXXL_ALGO_ADAPTOR_HEADER
23 template <
unsigned BlockSize,
typename RunType,
class PosType =
int_type>
30 block_size = BlockSize
36 using parent_type::array;
37 using parent_type::pos;
57 return (
BID<BlockSize>&)((*(array[(pos) % dim_size]))[(pos) / dim_size].bid);
63 return &((*(array[(pos) % dim_size])[(pos) / dim_size].bid));
70 return (
BID<BlockSize>&)((*(array[(n) % dim_size]))[(n) / dim_size].bid);
76 template <
unsigned BlockSize, typename RunType, class PosType =
int_type>
86 using base_type::array;
89 block_size = BlockSize
96 w(_w), h(_h), K(_w * _h)
101 w(a.w), h(a.h), K(a.K)
104 const self_type& operator = (
const self_type& a)
114 data_type& operator * ()
125 const data_type* operator -> ()
const
129 return &((*(array[(pos) % w])[(pos) / w].bid));
133 return &((*(array[(i) % _w])[h + (i / _w)].bid));
136 data_type& operator [] (PosType n)
const
151 template <typename trigger_iterator_type>
155 typedef typename std::iterator_traits<trigger_iterator_type>::value_type::bid_type
bid_type;
169 bid_type& operator * ()
173 bid_type* operator -> ()
const
175 return &(value->bid);
179 return (value + n)->bid;
183 return (value + n)->bid;
193 self_type tmp = *
this;
204 self_type tmp = *
this;
210 return value == a.
value;
214 return value != a.
value;
228 return value - a.
value;
232 return value + a.
value;
236 template <
typename Iterator>
238 trigger_entry_iterator<Iterator>
246 #endif // !STXXL_ALGO_ADAPTOR_HEADER
runs2bid_array_adaptor< BlockSize, RunType, PosType > self_type
two2one_dim_array_adapter_base< RunType *, BID< BlockSize >, PosType > base_type
trigger_entry_iterator< Iterator > make_bid_iterator(Iterator iter)
runs2bid_array_adaptor(const self_type &a)
std::random_access_iterator_tag iterator_category
runs2bid_array_adaptor(RunType **a, PosType p, unsigned_type d)
two2one_dim_array_adapter_base< RunType *, BID< BlockSize >, PosType > parent_type
uint_pair & operator++()
prefix increment operator (directly manipulates the integer parts)
trigger_entry_iterator(trigger_iterator_type v)
BID< BlockSize > data_type
trigger_entry_iterator(const self_type &a)
runs2bid_array_adaptor2(RunType **a, PosType p, int_type _w, int_type _h)
uint_pair & operator+=(const uint_pair &b)
addition operator (uses 64-bit arithmetic)
bool operator!=(const uint_pair &b) const
inequality checking operator
choose_int_types< my_pointer_size >::int_type int_type
#define STXXL_BEGIN_NAMESPACE
uint_pair & operator--()
prefix decrement operator (directly manipulates the integer parts)
trigger_iterator_type value
#define BLOCK_ADAPTOR_OPERATORS(two_to_one_dim_array_adaptor_base)
runs2bid_array_adaptor2< BlockSize, RunType, PosType > self_type
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
trigger_entry_iterator< trigger_iterator_type > self_type
one_dim_array_type * array
BID< BlockSize > data_type
#define CHECK_RUN_BOUNDS(pos)
runs2bid_array_adaptor2(const self_type &a)
std::iterator_traits< trigger_iterator_type >::value_type::bid_type bid_type
bool operator==(const uint_pair &b) const
equality checking operator
#define STXXL_END_NAMESPACE