Go to the documentation of this file.
20 #ifndef TLX_SORT_STRINGS_STRING_PTR_HEADER
21 #define TLX_SORT_STRINGS_STRING_PTR_HEADER
34 namespace sort_strings_detail {
36 template <
typename StringSet_>
37 class StringShadowPtr;
39 template <
typename StringSet_,
typename LcpType_>
40 class StringShadowLcpPtr;
46 template <
typename StringSet_>
51 typedef typename StringSet::String
String;
70 assert(offset + sub_size <=
size());
78 template <
typename LcpType>
79 void set_lcp(
size_t ,
const LcpType& )
const { }
82 template <
typename LcpType>
96 template <
typename StringSet_,
typename LcpType_>
102 typedef typename StringSet::String
String;
124 assert(offset + sub_size <=
size());
151 for (
size_t i = 1; i <
size(); ++i)
167 template <
typename StringSet_>
172 typedef typename StringSet::String
String;
202 assert(offset + sub_size <=
size());
204 shadow_.subi(offset, offset + sub_size),
211 assert(offset + sub_size <=
size());
213 active_.subi(offset, offset + sub_size),
233 template <
typename LcpType>
234 void set_lcp(
size_t ,
const LcpType& )
const { }
237 template <
typename LcpType>
238 void fill_lcp(
const LcpType& )
const { }
246 template <
typename StringSet_,
typename LcpType_>
252 typedef typename StringSet::String
String;
253 typedef typename StringSet::Iterator
Iterator;
285 assert(offset + sub_size <=
size());
287 shadow_.subi(offset, offset + sub_size),
294 assert(offset + sub_size <=
size());
296 active_.subi(offset, offset + sub_size),
334 for (
size_t i = 1; i <
size(); ++i)
341 template <
typename StringSet_>
347 template <
typename StringSet_,
typename LcpType_>
361 #endif // !TLX_SORT_STRINGS_STRING_PTR_HEADER
StringShadowLcpPtr(const StringSet &original, const StringSet &shadow, LcpType *lcp, bool flipped=false)
constructor specifying all attributes
void fill_lcp(const LcpType &v) const
fill entire LCP array with v, excluding the first lcp[0] position!
const StringSet & active() const
return currently active array
Objectified string array pointer and shadow pointer array for out-of-place swapping of pointers.
void set_lcp(size_t, const LcpType &) const
set the i-th lcp to v and check its value
StringShadowLcpPtr copy_back() const
return subarray pointer to n strings in original array, might copy from shadow before returning.
Objectified string and LCP array pointer arrays.
StringSet::Iterator Iterator
void fill_lcp(const LcpType &) const
fill entire LCP array with v, excluding the first lcp[0] position!
StringShadowPtr< StringSet_ > WithShadow
objectified string and shadow pointer class
StringShadowPtr sub(size_t offset, size_t sub_size) const
Advance (both) pointers by given offset, return sub-array without flip.
StringSet active_
strings (front) array
const StringSet & shadow() const
return current shadow array
StringShadowPtr(const StringSet &original, const StringSet &shadow, bool flipped=false)
constructor specifying all attributes
StringPtr sub(size_t offset, size_t sub_size) const
Advance (both) pointers by given offset, return sub-array.
bool flipped() const
true if flipped to back array
static const bool with_lcp
if we want to save the LCPs
StringShadowLcpPtr sub(size_t offset, size_t sub_size) const
Advance (both) pointers by given offset, return sub-array without flip.
StringSet active_
strings (front) and temporary shadow (back) array
void set_lcp(size_t, const LcpType &) const
set the i-th lcp to v and check its value
const StringSet & active() const
return currently active array
LcpType get_lcp(size_t i) const
return LCP array value
size_t size() const
return valid length
LcpType * lcp() const
return LCP array pointer
static const bool with_lcp
if we want to save the LCPs
StringShadowPtr flip(size_t offset, size_t sub_size) const
construct a StringShadowPtr object specifying a sub-array with flipping to other array.
static const bool with_lcp
if we want to save the LCPs
void fill_lcp(const LcpType &v) const
fill entire LCP array with v, excluding the first lcp[0] position!
StringLcpPtr sub(size_t offset, size_t sub_size) const
Advance (both) pointers by given offset, return sub-array.
void set_lcp(size_t i, const LcpType &v) const
set the i-th lcp to v and check its value
static const bool with_lcp
if we want to save the LCPs
bool flipped_
false if active_ is original, true if shadow_ is original
LcpType get_lcp(size_t i) const
return LCP array value
StringSet active_
strings (front) and temporary shadow (back) array
const StringSet & shadow() const
return current shadow array
bool flipped_
false if active_ is original, true if shadow_ is original
size_t size() const
return valid length
StringShadowPtr copy_back() const
return subarray pointer to n strings in original array, might copy from shadow before returning.
Objectified string array pointer and shadow pointer array for out-of-place swapping of pointers.
StringSet active_
strings (front) array
void set_lcp(size_t i, const LcpType &v) const
set the i-th lcp to v and check its value
Objectified string array pointer array.
StringShadowLcpPtr flip(size_t offset, size_t sub_size) const
construct a StringShadowLcpPtr object specifying a sub-array with flipping to other array.
StringLcpPtr(const StringSet &ss, LcpType *lcp)
constructor specifying all attributes
WithShadow add_shadow(const StringSet &shadow) const
construct objectified string and shadow pointer class
StringShadowLcpPtr< StringSet_, LcpType_ > WithShadow
objectified string and shadow pointer class
WithShadow add_shadow(const StringSet &shadow) const
construct objectified string and shadow pointer class
size_t size() const
return valid length
void fill_lcp(const LcpType &) const
fill entire LCP array with v, excluding the first lcp[0] position!
size_t size() const
return valid length
StringSet::Iterator Iterator
LcpType * lcp() const
return LCP array pointer
bool flipped() const
true if flipped to back array
StringPtr(const StringSet &ss)
constructor specifying all attributes
const StringSet & active() const
return currently active array
const StringSet & active() const
return currently active array