+ usint c = this->getCharacter(index);
+ return iters[c]->selectRun(index - this->index_ranges[c].first, max_length);
+ }
+
+ // Returns psi(index), assuming the suffix of rank index begins with c.
+ inline usint psiUnsafe(usint index, usint c) const
+ {
+ PsiVector::Iterator iter(*(this->array[c]));
+ return this->psiUnsafe(index, c, iter);
+ }
+
+ // As above, but with a given iterator.
+ inline usint psiUnsafe(usint index, usint c, PsiVector::Iterator& iter) const
+ {
+ return iter.select(index - this->index_ranges[c].first);
+ }
+
+ // As above, but returns the next value of psi.
+ inline usint psiUnsafeNext(usint c, PsiVector::Iterator& iter) const
+ {
+ return iter.selectNext();
+ }
+
+ inline pair_type backwardSearchStep(pair_type range, usint c) const
+ {
+ if(this->array[c] == 0) { return EMPTY_PAIR; }
+ PsiVector::Iterator iter(*(this->array[c]));
+
+ usint start = this->index_ranges[c].first + this->number_of_sequences - 1;
+ range.first = start + iter.rank(range.first, true);
+ range.second = start + iter.rank(range.second);
+
+ return range;
+ }
+
+ inline usint LF(usint index, usint c, PsiVector::Iterator& iter) const
+ {
+ return this->index_ranges[c].first + this->number_of_sequences + iter.rank(index) - 1;
+ }
+
+//--------------------------------------------------------------------------
+// INTERNAL STUFF
+//--------------------------------------------------------------------------
+
+ // Creates an array of iterators for every vector in this->array.
+ PsiVector::Iterator** getIterators() const;
+ void deleteIterators(PsiVector::Iterator** iters) const;
+
+ inline usint getCharacter(usint pos) const
+ {
+ const usint* curr = &(this->text_chars[this->index_pointers[pos / this->index_rate]]);