59template <
typename derived_t, two_dimensional_matrix_iterator matrix_iter_t>
63 static_assert(std::same_as<std::iter_value_t<matrix_iter_t>,
trace_directions>,
64 "Value type of the underlying iterator must be seqan3::detail::trace_directions.");
67 template <
typename other_derived_t, two_dimensional_matrix_iterator other_matrix_iter_t>
101 template <
typename other_derived_t, two_dimensional_matrix_iterator other_matrix_iter_t>
102 requires std::constructible_from<matrix_iter_t, other_matrix_iter_t>
137 [[nodiscard]]
constexpr matrix_coordinate
coordinate() const noexcept
192 return lhs.matrix_iter == rhs.matrix_iter;
204 return rhs == std::default_sentinel;
210 return !(lhs == rhs);
216 return !(lhs == std::default_sentinel);
222 return !(rhs == std::default_sentinel);
232 constexpr void go_left(matrix_iter_t & iter)
const noexcept
238 constexpr void go_up(matrix_iter_t & iter)
const noexcept
280 return static_cast<derived_t const &
>(*this);
A CRTP-base class for trace iterator implementations for the alignment algorithms.
Definition trace_iterator_base.hpp:61
constexpr friend bool operator!=(std::default_sentinel_t const &, derived_t const &rhs) noexcept
copydoc operator!=()
Definition trace_iterator_base.hpp:220
constexpr friend bool operator==(derived_t const &lhs, derived_t const &rhs) noexcept
Returns true if both iterators are equal, false otherwise.
Definition trace_iterator_base.hpp:190
constexpr friend bool operator==(std::default_sentinel_t const &, derived_t const &rhs) noexcept
copydoc operator==()
Definition trace_iterator_base.hpp:202
matrix_iter_t matrix_iter
The underlying matrix iterator.
Definition trace_iterator_base.hpp:283
constexpr derived_t & derived() noexcept
Cast this object to its derived type.
Definition trace_iterator_base.hpp:272
trace_directions const & reference
The reference type.
Definition trace_iterator_base.hpp:115
constexpr trace_iterator_base & operator=(trace_iterator_base const &)=default
Defaulted.
constexpr trace_iterator_base(trace_iterator_base< other_derived_t, other_matrix_iter_t > const &other) noexcept
Constructs from the underlying trace matrix iterator indicating the start of the trace path.
Definition trace_iterator_base.hpp:103
constexpr trace_iterator_base(trace_iterator_base const &)=default
Defaulted.
constexpr derived_t operator++(int) noexcept
Returns an iterator advanced by one.
Definition trace_iterator_base.hpp:178
friend derived_t
Befriend the derived iterator class to allow calling the private constructors.
Definition trace_iterator_base.hpp:71
constexpr friend bool operator==(derived_t const &lhs, std::default_sentinel_t const &) noexcept
Returns true if the pointed-to-element is seqan3::detail::trace_directions::none.
Definition trace_iterator_base.hpp:196
constexpr void go_left(matrix_iter_t &iter) const noexcept
Moves iterator to previous left cell.
Definition trace_iterator_base.hpp:232
constexpr trace_iterator_base()=default
Defaulted.
void set_trace_direction(trace_directions const dir) noexcept
Updates the current trace direction.
Definition trace_iterator_base.hpp:251
constexpr matrix_coordinate coordinate() const noexcept
Returns the current coordinate in two-dimensional space.
Definition trace_iterator_base.hpp:137
value_type const * pointer
The pointer type.
Definition trace_iterator_base.hpp:116
constexpr trace_iterator_base(matrix_iter_t const matrix_iter) noexcept
Constructs from the underlying trace matrix iterator indicating the start of the trace path.
Definition trace_iterator_base.hpp:86
constexpr friend bool operator!=(derived_t const &lhs, std::default_sentinel_t const &) noexcept
Returns true if the pointed-to-element is not seqan3::detail::trace_directions::none.
Definition trace_iterator_base.hpp:214
trace_directions current_direction
The current trace direction.
Definition trace_iterator_base.hpp:284
constexpr trace_iterator_base(trace_iterator_base &&)=default
Defaulted.
constexpr derived_t & operator++() noexcept
Advances the iterator by one.
Definition trace_iterator_base.hpp:147
constexpr void go_up(matrix_iter_t &iter) const noexcept
Moves iterator to previous up cell.
Definition trace_iterator_base.hpp:238
pointer operator->() const noexcept
Returns a pointer to the current trace direction.
Definition trace_iterator_base.hpp:131
constexpr void go_diagonal(matrix_iter_t &iter) const noexcept
Moves iterator to previous diagonal cell.
Definition trace_iterator_base.hpp:244
constexpr trace_iterator_base & operator=(trace_iterator_base &&)=default
Defaulted.
~trace_iterator_base()=default
Defaulted.
constexpr derived_t const & derived() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition trace_iterator_base.hpp:278
reference operator*() const noexcept
Returns the current trace direction.
Definition trace_iterator_base.hpp:125
constexpr friend bool operator!=(derived_t const &lhs, derived_t const &rhs) noexcept
Returns true if both iterators are not equal, false otherwise.
Definition trace_iterator_base.hpp:208
trace_directions
The possible directions a trace can have. The values can be combined by the logical |-operator.
Definition trace_directions.hpp:26
@ carry_left_open
Carry bit for the last left open even if it is not the maximum value.
@ up
Trace comes from the above entry.
@ left
Trace comes from the left entry.
@ diagonal
Trace comes from the diagonal entry.
@ carry_up_open
Carry bit for the last up open even if it is not the maximum value.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
A strong type for designated initialisation of the column index of a matrix.
Definition matrix_coordinate.hpp:29
A representation of a location or offset within a two-dimensional matrix.
Definition matrix_coordinate.hpp:87
A strong type for designated initialisation of the row index of a matrix.
Definition matrix_coordinate.hpp:58
Provides the declaration of seqan3::detail::trace_directions.
Provides seqan3::detail::two_dimensional_matrix_iterator_base.
Provides seqan3::detail::two_dimensional_matrix_iterator.