42 template <
typename StreamType,
48 typename PackedStream<const_cached_iterator<const W*>,SymbolType,SYMBOL_SIZE_T,BIG_ENDIAN_T>::iterator
54 typedef typename std::iterator_traits<StreamType>::value_type word_type;
56 const StreamType in_storage = in_stream.
stream();
58 const uint32 SYMBOLS_PER_WORD = (
sizeof(word_type)*8) / SYMBOL_SIZE_T;
60 const uint32 word_offset = storage_offset & (SYMBOLS_PER_WORD-1);
61 const uint32 begin_word = storage_offset / SYMBOLS_PER_WORD;
62 const uint32 end_word = (storage_offset + N + SYMBOLS_PER_WORD-1) / SYMBOLS_PER_WORD;
65 for (
uint32 word = begin_word; word < end_word; ++word)
66 lmem[ word - begin_word ] = in_storage[ word ];
69 const_stream_type clmem_stream( lmem );
71 return clmem_stream.begin() + word_offset;
75 template <
typename StreamType,
85 const uint2 substring_range,
89 typedef typename std::iterator_traits<StreamType>::value_type word_type;
91 const StreamType in_storage = in_stream.
stream();
93 const uint32 SYMBOLS_PER_WORD = (
sizeof(word_type)*8) / SYMBOL_SIZE_T;
95 const uint32 word_offset = storage_offset & (SYMBOLS_PER_WORD-1);
96 const uint32 base_word = storage_offset / SYMBOLS_PER_WORD;
97 const uint32 begin_word = (storage_offset + (rev_flag ? N - substring_range.y : substring_range.x)) / SYMBOLS_PER_WORD;
98 const uint32 end_word = (storage_offset + (rev_flag ? N - substring_range.x : substring_range.y) + SYMBOLS_PER_WORD-1) / SYMBOLS_PER_WORD;
101 for (
uint32 word = begin_word; word < end_word; ++word)
102 lmem[ word - base_word ] = in_storage[ word ];
105 const_stream_type clmem_stream( lmem );
107 return clmem_stream.begin() + word_offset;
116 template <
typename StorageIterator, u
int32 SYMBOL_SIZE_T,
bool BIG_ENDIAN_T, u
int32 CACHE_SIZE>
118 typename PackedStringLoader<StorageIterator,SYMBOL_SIZE_T,BIG_ENDIAN_T,lmem_cache_tag<CACHE_SIZE> >::iterator
124 template <
typename StorageIterator, u
int32 SYMBOL_SIZE_T,
bool BIG_ENDIAN_T, u
int32 CACHE_SIZE>
130 const uint2 substring_range,
140 template <
typename StorageIterator, u
int32 SYMBOL_SIZE_T,
bool BIG_ENDIAN_T>
148 template <
typename StorageIterator, u
int32 SYMBOL_SIZE_T,
bool BIG_ENDIAN_T>
154 const uint2 substring_range,