SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
|
A crtp-base class for iterators over seqan3::detail::two_dimensional_matrix. More...
#include <seqan3/alignment/matrix/detail/two_dimensional_matrix_iterator_base.hpp>
Public Member Functions | |
Element access | |
template<typename dummy_t = derived_t> | |
constexpr reference< dummy_t > | operator* () const noexcept |
Returns a reference to the pointed to element. | |
template<typename dummy_t = derived_t> | |
constexpr reference< dummy_t > | operator[] (std::iter_difference_t< dummy_t > const offset) const noexcept |
Returns a reference to the pointed-to-element after advancing the iterator by the given offset. | |
template<typename dummy_t = derived_t> | |
constexpr reference< dummy_t > | operator[] (matrix_offset const &offset) const noexcept |
Returns a reference to the pointed-to-element after advancing the iterator by the given offset. | |
template<typename dummy_t = derived_t> | |
constexpr pointer< dummy_t > | operator-> () const noexcept |
Returns a pointer to the pointed-to-element. | |
constexpr seqan3::detail::matrix_coordinate | coordinate () const noexcept |
Returns the current position of the iterator as a seqan3::detail::matrix_coordinate. | |
Comparison operators | |
template<typename other_derived_t > requires std::constructible_from<derived_t, other_derived_t> || std::constructible_from<other_derived_t, derived_t> | |
constexpr bool | operator== (two_dimensional_matrix_iterator_base< other_derived_t, order > const &rhs) const noexcept |
Returns true if both iterators are equal, false otherwise. | |
template<typename other_derived_t > requires std::constructible_from<derived_t, other_derived_t> || std::constructible_from<other_derived_t, derived_t> | |
constexpr bool | operator!= (two_dimensional_matrix_iterator_base< other_derived_t, order > const &rhs) const noexcept |
Returns true if both iterators are unequal, false otherwise. | |
template<typename other_derived_t > requires std::constructible_from<derived_t, other_derived_t> || std::constructible_from<other_derived_t, derived_t> | |
constexpr bool | operator< (two_dimensional_matrix_iterator_base< other_derived_t, order > const &rhs) const noexcept |
Checks if lhs is smaller than rhs . | |
template<typename other_derived_t > requires std::constructible_from<derived_t, other_derived_t> || std::constructible_from<other_derived_t, derived_t> | |
constexpr bool | operator<= (two_dimensional_matrix_iterator_base< other_derived_t, order > const &rhs) const noexcept |
Checks if lhs is smaller than or equal to rhs . | |
template<typename other_derived_t > requires std::constructible_from<derived_t, other_derived_t> || std::constructible_from<other_derived_t, derived_t> | |
constexpr bool | operator> (two_dimensional_matrix_iterator_base< other_derived_t, order > const &rhs) const noexcept |
Checks if lhs is greater than rhs . | |
template<typename other_derived_t > requires std::constructible_from<derived_t, other_derived_t> || std::constructible_from<other_derived_t, derived_t> | |
constexpr bool | operator>= (two_dimensional_matrix_iterator_base< other_derived_t, order > const &rhs) const noexcept |
Checks if lhs is greater than or equal to rhs . | |
Private Member Functions | |
constexpr derived_t & | as_derived () |
Cast this to derived type. | |
constexpr derived_t const & | as_derived () const |
Cast this to derived type. | |
constexpr auto const & | as_host_iter () const |
Return the host_iter of the derived type. | |
Constructors, destructor and assignment | |
constexpr | two_dimensional_matrix_iterator_base ()=default |
Defaulted. | |
constexpr | two_dimensional_matrix_iterator_base (two_dimensional_matrix_iterator_base const &)=default |
Defaulted. | |
constexpr | two_dimensional_matrix_iterator_base (two_dimensional_matrix_iterator_base &&)=default |
Defaulted. | |
constexpr two_dimensional_matrix_iterator_base & | operator= (two_dimensional_matrix_iterator_base const &)=default |
Defaulted. | |
constexpr two_dimensional_matrix_iterator_base & | operator= (two_dimensional_matrix_iterator_base &&)=default |
Defaulted. | |
~two_dimensional_matrix_iterator_base ()=default | |
Defaulted. | |
Private Attributes | |
friend | derived_t |
Befriend the derived type. | |
Friends | |
template<typename other_derived_t , matrix_major_order other_order> | |
class | two_dimensional_matrix_iterator_base |
Befriend other base class types for const iterator compatibility. | |
Arithmetic operators | |
template<typename dummy_t = derived_t> | |
constexpr friend derived_t | operator+ (std::iter_difference_t< dummy_t > const offset, derived_t const iter) |
Returns an iterator advanced by offset following the given matrix major order. | |
constexpr friend derived_t | operator+ (matrix_offset const &offset, derived_t const iter) |
Returns an iterator advanced by offset in the respective dimensions. | |
template<typename dummy_t = derived_t> | |
constexpr std::iter_difference_t< dummy_t > | operator- (derived_t const lhs, derived_t const rhs) noexcept |
Returns the distance between two iterators. | |
constexpr derived_t & | operator+= (matrix_offset const &offset) noexcept |
Advances the iterator by the given offset in the respective matrix dimensions. | |
constexpr derived_t & | operator++ () noexcept |
Advances the iterator by one following the given matrix major order. | |
constexpr derived_t | operator++ (int) noexcept |
Returns an iterator incremented by one following the given matrix major order. | |
template<typename dummy_t = derived_t> | |
constexpr derived_t & | operator+= (std::iter_difference_t< dummy_t > const offset) noexcept |
Advances the iterator by offset following the given matrix major order. | |
template<typename dummy_t = derived_t> | |
constexpr derived_t | operator+ (std::iter_difference_t< dummy_t > const offset) const noexcept |
Returns an iterator advanced by offset following the given matrix major order. | |
constexpr derived_t | operator+ (matrix_offset const &offset) const noexcept |
Returns an iterator advanced by offset in the respective dimensions. | |
constexpr derived_t & | operator-- () noexcept |
Advances the iterator by minus one following the given matrix major order. | |
constexpr derived_t | operator-- (int) noexcept |
Returns an iterator decremented by one following the given matrix major order. | |
template<typename dummy_t = derived_t> | |
constexpr derived_t & | operator-= (std::iter_difference_t< dummy_t > const offset) noexcept |
Advances the iterator by offset following the given matrix major order. | |
template<typename dummy_t = derived_t> | |
constexpr derived_t | operator- (std::iter_difference_t< dummy_t > const offset) const noexcept |
Returns an iterator advanced by offset following the given matrix major order. | |
constexpr derived_t & | operator-= (matrix_offset const &offset) noexcept |
Returns an iterator advanced by offset in the respective dimensions. | |
constexpr derived_t | operator- (matrix_offset const &offset) const noexcept |
Returns an iterator advanced by offset in the respective dimensions. | |
Additional Inherited Members | |
![]() | |
iterator & | operator+= (seqan3::detail::matrix_offset offset) noexcept |
Advances the iterator by offset in the respective dimension. | |
constexpr iterator | operator+ (seqan3::detail::matrix_offset offset) const noexcept |
Returns an iterator advanced by offset in the respective dimension. | |
constexpr friend iterator | operator+ (seqan3::detail::matrix_offset offset, iterator const iter) noexcept |
Returns an iterator advanced by offset in the respective dimension. | |
constexpr iterator & | operator-= (seqan3::detail::matrix_offset offset) noexcept |
Advances the iterator by offset in the respective dimension. | |
constexpr iterator | operator- (seqan3::detail::matrix_offset offset) const noexcept |
Returns an iterator advanced by offset in the respective dimension. | |
A crtp-base class for iterators over seqan3::detail::two_dimensional_matrix.
derived_t | The derived type that implements this base iterator. |
order | The seqan3::detail::matrix_major_order to use. |
This iterator provides a two-dimensional access interface over the seqan3::detail::two_dimensional_matrix, which stores the values in a one-dimensional vector. In addition to the regular interface using seqan3::detail::two_dimensional_matrix_iterator_base::difference_type<dummy_t> this iterator offers special operators for advancing the iterator in a two-dimensional layout using seqan3::detail::matrix_offset. The underlying iterator is moved along the respective row and column offset according to the specialised seqan3::detail::matrix_major_order.
The regular interface moves the wrapped iterator according to the specified seqan3::detail::matrix_major_order, i.e. if order
is seqan3::detail::matrix_major_order::column it advances the iterator first in vertical dimension and second in horizontal dimension and if order
is seqan3::detail::matrix_major_order::row the other way around.
Types that implement this abstract base class must provide the associated types for iterators and shall implement the following functions in order to work properly:
|
no-apiinlineconstexprprivate |
Cast this to derived type.
|
no-apiinlineconstexprnoexcept |
Returns the current position of the iterator as a seqan3::detail::matrix_coordinate.
The position of the iterator is stored as a seqan3::detail::matrix_coordinate mapping the one-dimensional vector position to a two-dimensional point coordinate.
Implements seqan3::detail::two_dimensional_matrix_iterator< iter_t >.
|
no-apiinlineconstexprnoexcept |
Advances the iterator by the given offset in the respective matrix dimensions.
[in] | offset | The matrix offset used to advance the iterator. |
Advances the given host iterator (the iterator over the one-dimensional vector) by the given matrix coordinate offset. Independent of the seqan3::detail::matrix_major_order the host iterator is advanced to the correct position within the underlying one-dimensional vector as if it where a two-dimensional matrix.