SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::advanceable_alignment_coordinate< state > Class Template Reference

Implements an internal alignment coordinate that can be used as an argument to the std::ranges::iota_view. More...

#include <seqan3/alignment/matrix/detail/advanceable_alignment_coordinate.hpp>

+ Inheritance diagram for seqan3::detail::advanceable_alignment_coordinate< state >:

Public Types

Member types
using difference_type = std::make_signed_t< size_t >
 Defines the difference type to model the std::weakly_incrementable concept.
 

Public Member Functions

Constructors, destructor and assignment
constexpr advanceable_alignment_coordinate () noexcept=default
 
constexpr advanceable_alignment_coordinate (advanceable_alignment_coordinate const &) noexcept=default
 Defaulted.
 
constexpr advanceable_alignment_coordinate (advanceable_alignment_coordinate &&) noexcept=default
 
constexpr advanceable_alignment_coordinateoperator= (advanceable_alignment_coordinate const &) noexcept=default
 Defaulted.
 
constexpr advanceable_alignment_coordinateoperator= (advanceable_alignment_coordinate &&) noexcept=default
 Defaulted.
 
 ~advanceable_alignment_coordinate () noexcept=default
 Defaulted.
 
template<advanceable_alignment_coordinate_state other_state>
requires (other_state != state)
constexpr advanceable_alignment_coordinate (advanceable_alignment_coordinate< other_state > const &other)
 Copy-constructs from another advanceable_alignment_coordinate with a different policy.
 
template<advanceable_alignment_coordinate_state other_state>
requires (other_state != state)
constexpr advanceable_alignment_coordinate (advanceable_alignment_coordinate< other_state > &&other)
 Move-constructs from another advanceable_alignment_coordinate with a different policy.
 
constexpr advanceable_alignment_coordinate (column_index_type< size_t > const c_idx, row_index_type< size_t > const r_idx) noexcept
 Construction from the respective column and row indices.
 
Member functions

Advances or decrements the respective column or row coordinate depending on the set policy. These member functions are not available if the non-type template parameter state was set to seqan3::detail::advanceable_alignment_coordinate_state::none.

constexpr advanceable_alignment_coordinateoperator++ () noexcept
 Increments the coordinate depending on the set policy by one.
 
constexpr advanceable_alignment_coordinate operator++ (int) noexcept
 Post-increments the coordinate depending on the set policy by one.
 
constexpr advanceable_alignment_coordinateoperator-- () noexcept
 Decrements the coordinate depending on the set policy by one.
 
constexpr advanceable_alignment_coordinate operator-- (int) noexcept
 Post-decrements the coordinate depending on the set policy by one.
 
constexpr advanceable_alignment_coordinateoperator+= (difference_type const offset) noexcept
 Returns the coordinate which is advanced depending on the set policy by offset.
 
constexpr advanceable_alignment_coordinateoperator-= (difference_type const offset) noexcept
 Returns the coordinate which is advanced depending on the set policy by -offset.
 
constexpr advanceable_alignment_coordinate operator+ (difference_type const offset) const noexcept
 Returns a new coordinate which is advanced depending on the set policy by offset.
 
constexpr advanceable_alignment_coordinate operator- (difference_type const offset) const noexcept
 Returns a new coordinate which is advanced depending on the set policy by -offset.
 
constexpr difference_type operator- (advanceable_alignment_coordinate const &other) const noexcept
 Returns the difference of this and another coordinate depending on the set policy.
 

Public Attributes

size_t first {}
 The front/back position of the alignment in the first sequence.
 
size_t second {}
 The front/back position of the alignment in the second sequence.
 

Friends

constexpr friend advanceable_alignment_coordinate operator+ (difference_type const offset, advanceable_alignment_coordinate const &me) noexcept
 Non-member function.
 

Detailed Description

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
class seqan3::detail::advanceable_alignment_coordinate< state >

Implements an internal alignment coordinate that can be used as an argument to the std::ranges::iota_view.

Template Parameters
statesA non-type template flag to enable a specific advanceable policy.
See also
seqan3::detail::advanceable_alignment_coordinate_state.

This class provides all members to make the advanceable_alignment_coordinate be usable in a std::ranges::iota_view. For the purpose of alignments, modelling only incrementable and decrementable would fully suffice. Unfortunately, the current range implementation does not preserve std::ranges::bidirectional_range properties, so we need to model the full advanceable concept in order to preserve the std::ranges::random_access_range properties. This, however, can be relaxed if the range implementation fully complies with the current standard draft for Ranges, as increment and decrement would be enough and std::views::iota would preserve std::ranges::bidirectional_range.

Constructor & Destructor Documentation

◆ advanceable_alignment_coordinate() [1/3]

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr seqan3::detail::advanceable_alignment_coordinate< state >::advanceable_alignment_coordinate ( )
constexprdefaultnoexcept

Defaulted

◆ advanceable_alignment_coordinate() [2/3]

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr seqan3::detail::advanceable_alignment_coordinate< state >::advanceable_alignment_coordinate ( advanceable_alignment_coordinate< state > &&  )
constexprdefaultnoexcept

Defaulted

◆ advanceable_alignment_coordinate() [3/3]

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr seqan3::detail::advanceable_alignment_coordinate< state >::advanceable_alignment_coordinate ( column_index_type< size_t > const  c_idx,
row_index_type< size_t > const  r_idx 
)
inlineconstexprnoexcept

Construction from the respective column and row indices.

Parameters
c_idxThe respective column index within the matrix. Of type seqan3::detail::column_index_type.
r_idxThe respective row index within the matrix. Of type seqan3::detail::row_index_type.

Member Function Documentation

◆ operator+()

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr advanceable_alignment_coordinate seqan3::detail::advanceable_alignment_coordinate< state >::operator+ ( difference_type const  offset) const
inlineconstexprnoexcept

Returns a new coordinate which is advanced depending on the set policy by offset.

Parameters
offsetThe value to add to the coordinate.
Returns
a seqan3::detail::advanceable_alignment_coordinate that holds the updated value.

◆ operator++() [1/2]

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr advanceable_alignment_coordinate & seqan3::detail::advanceable_alignment_coordinate< state >::operator++ ( )
inlineconstexprnoexcept

Increments the coordinate depending on the set policy by one.

Returns
*this

◆ operator++() [2/2]

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr advanceable_alignment_coordinate seqan3::detail::advanceable_alignment_coordinate< state >::operator++ ( int  )
inlineconstexprnoexcept

Post-increments the coordinate depending on the set policy by one.

Returns
a seqan3::detail::advanceable_alignment_coordinate that holds an unchanged value.

◆ operator+=()

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr advanceable_alignment_coordinate & seqan3::detail::advanceable_alignment_coordinate< state >::operator+= ( difference_type const  offset)
inlineconstexprnoexcept

Returns the coordinate which is advanced depending on the set policy by offset.

Parameters
offsetThe value to add to the coordinate.
Returns
*this

◆ operator-() [1/2]

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr difference_type seqan3::detail::advanceable_alignment_coordinate< state >::operator- ( advanceable_alignment_coordinate< state > const &  other) const
inlineconstexprnoexcept

Returns the difference of this and another coordinate depending on the set policy.

Parameters
otherThe other coordinate.
Returns
the difference between the coordinates.

◆ operator-() [2/2]

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr advanceable_alignment_coordinate seqan3::detail::advanceable_alignment_coordinate< state >::operator- ( difference_type const  offset) const
inlineconstexprnoexcept

Returns a new coordinate which is advanced depending on the set policy by -offset.

Parameters
offsetThe value to subtract from the coordinate.
Returns
a seqan3::detail::advanceable_alignment_coordinate that holds the updated value.

◆ operator--() [1/2]

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr advanceable_alignment_coordinate & seqan3::detail::advanceable_alignment_coordinate< state >::operator-- ( )
inlineconstexprnoexcept

Decrements the coordinate depending on the set policy by one.

Returns
*this

◆ operator--() [2/2]

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr advanceable_alignment_coordinate seqan3::detail::advanceable_alignment_coordinate< state >::operator-- ( int  )
inlineconstexprnoexcept

Post-decrements the coordinate depending on the set policy by one.

Returns
a seqan3::detail::advanceable_alignment_coordinate that holds an unchanged value.

◆ operator-=()

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr advanceable_alignment_coordinate & seqan3::detail::advanceable_alignment_coordinate< state >::operator-= ( difference_type const  offset)
inlineconstexprnoexcept

Returns the coordinate which is advanced depending on the set policy by -offset.

Parameters
offsetThe value to subtract from the coordinate.
Returns
*this

Friends And Related Symbol Documentation

◆ operator+

template<advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
constexpr friend advanceable_alignment_coordinate operator+ ( difference_type const  offset,
advanceable_alignment_coordinate< state > const &  me 
)
friend

Non-member function.

Advances the respective coordinate depending on the set policy by the given offset. This function is not available if the policy was set to seqan3::detail::advanceable_alignment_coordinate_state::none.


The documentation for this class was generated from the following file:
Hide me