14 #ifndef STXXL_ALGO_ADAPTOR_HEADER
15 #define STXXL_ALGO_ADAPTOR_HEADER
23 template <
unsigned _blk_sz,
typename _run_type,
class __pos_type =
int_type>
29 enum { block_size = _blk_sz };
55 return (
BID<_blk_sz>&)((*(array[(pos) % dim_size]))[(pos) / dim_size].bid);
61 return &((*(array[(pos) % dim_size])[(pos) / dim_size].bid));
69 return (
BID<_blk_sz>&)((*(array[(n) % dim_size]))[(n) / dim_size].bid);
75 template <
unsigned _blk_sz, typename _run_type, class __pos_type =
int_type>
84 using ParentClass_::pos;
85 using ParentClass_::array;
88 { block_size = _blk_sz };
94 w(_w), h(_h), K(_w * _h)
99 w(a.w), h(a.h), K(a.K)
102 const _Self& operator = (
const _Self& a)
112 data_type& operator * ()
114 register __pos_type i = pos - K;
116 return (
BID<_blk_sz>&)((*(array[(pos) % w]))[(pos) / w].bid);
118 register __pos_type _w = w;
120 return (
BID<_blk_sz>&)((*(array[(i) % _w]))[h + (i / _w)].bid);
123 const data_type* operator -> ()
const
125 register __pos_type i = pos - K;
127 return &((*(array[(pos) % w])[(pos) / w].bid));
130 register __pos_type _w = w;
132 return &((*(array[(i) % _w])[h + (i / _w)].bid));
136 data_type& operator [] (__pos_type n)
const
139 register __pos_type i = n - K;
141 return (
BID<_blk_sz>&)((*(array[(n) % w]))[(n) / w].bid);
144 register __pos_type _w = w;
146 return (
BID<_blk_sz>&)((*(array[(i) % _w]))[h + (i / _w)].bid);
153 template <typename trigger_iterator_type>
157 typedef typename std::iterator_traits<trigger_iterator_type>::value_type::bid_type
bid_type;
171 bid_type& operator * ()
175 bid_type* operator -> ()
const
177 return &(value->bid);
181 return (value + n)->bid;
185 return (value + n)->bid;
212 return value == a.
value;
216 return value != a.
value;
230 return value - a.
value;
234 return value + a.
value;
238 template <
typename Iterator>
240 trigger_entry_iterator<Iterator>
248 #endif // !STXXL_ALGO_ADAPTOR_HEADER
two2one_dim_array_adapter_base< _run_type *, BID< _blk_sz >, __pos_type > ParentClass_
trigger_entry_iterator< Iterator > make_bid_iterator(Iterator iter)
runs2bid_array_adaptor(const _Self &a)
std::random_access_iterator_tag iterator_category
runs2bid_array_adaptor< _blk_sz, _run_type, __pos_type > _Self
one_dim_array_type * array
uint_pair & operator++()
prefix increment operator (directly manipulates the integer parts)
trigger_entry_iterator(trigger_iterator_type v)
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)
runs2bid_array_adaptor(_run_type **a, __pos_type p, unsigned_type d)
trigger_iterator_type value
#define BLOCK_ADAPTOR_OPERATORS(two_to_one_dim_array_adaptor_base)
two2one_dim_array_adapter_base< _run_type *, BID< _blk_sz >, __pos_type > _Parent
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
#define CHECK_RUN_BOUNDS(pos)
trigger_entry_iterator< trigger_iterator_type > _Self
std::iterator_traits< trigger_iterator_type >::value_type::bid_type bid_type
bool operator==(const uint_pair &b) const
equality checking operator
runs2bid_array_adaptor2(const _Self &a)
#define STXXL_END_NAMESPACE
runs2bid_array_adaptor2< _blk_sz, _run_type, __pos_type > _Self
runs2bid_array_adaptor2(_run_type **a, __pos_type p, int_type _w, int_type _h)
trigger_entry_iterator(const _Self &a)