Skip to content

Commit

Permalink
new member function children()
Browse files Browse the repository at this point in the history
  • Loading branch information
cpockrandt committed Aug 7, 2018
1 parent f74d38f commit df17567
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions include/seqan3/index/fm_index_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class fm_index_iterator
{
++c;
}

if (c != index->m_index.sigma)
{
parent_lb = node.lb;
Expand Down Expand Up @@ -193,7 +193,25 @@ class fm_index_iterator
return true;
}

bool right()
auto children() noexcept
{
// TODO: this will not work since value_size is not defined for char
std::array<fm_index_iterator, index_type::char_type::value_size> children;

// TODO: this will be implemented much more efficiently
uint8_t i = 0;
if (down())
{
do
{
children[i++] = *this;
} while (right());
}

return children;
}

bool right() noexcept
{
assert(depth() > 0);
typename index_type::comp_char_type c = node.last_char + 1;
Expand Down

0 comments on commit df17567

Please sign in to comment.