25 namespace seqan3::detail
38 enum struct advanceable_alignment_coordinate_state : uint8_t
63 template <advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
64 class advanceable_alignment_coordinate
73 using difference_type = std::make_signed_t<size_t>;
79 constexpr advanceable_alignment_coordinate() noexcept = default;
81 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate const &) noexcept = default;
82 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate &&) noexcept = default;
84 constexpr advanceable_alignment_coordinate & operator=(advanceable_alignment_coordinate const &) noexcept = default;
86 constexpr advanceable_alignment_coordinate & operator=(advanceable_alignment_coordinate &&) noexcept = default;
87 ~advanceable_alignment_coordinate() noexcept = default;
90 template <advanceable_alignment_coordinate_state other_state>
92 requires (other_state != state)
94 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate<other_state> const & other) :
100 template <advanceable_alignment_coordinate_state other_state>
102 requires (other_state != state)
104 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate<other_state> && other) :
106 second{
std::
move(other.second)}
113 constexpr advanceable_alignment_coordinate(column_index_type<size_t>
const c_idx,
114 row_index_type<size_t>
const r_idx) noexcept :
121 constexpr
friend bool operator==(advanceable_alignment_coordinate
const & lhs,
122 advanceable_alignment_coordinate
const & rhs) noexcept
124 return std::tie(lhs.first, lhs.second) == std::tie(rhs.first, rhs.second);
127 constexpr
friend bool operator!=(advanceable_alignment_coordinate
const & lhs,
128 advanceable_alignment_coordinate
const & rhs) noexcept
130 return std::tie(lhs.first, lhs.second) != std::tie(rhs.first, rhs.second);
133 constexpr
friend bool operator<=(advanceable_alignment_coordinate
const & lhs,
134 advanceable_alignment_coordinate
const & rhs) noexcept
136 return std::tie(lhs.first, lhs.second) <= std::tie(rhs.first, rhs.second);
139 constexpr
friend bool operator< (advanceable_alignment_coordinate
const & lhs,
140 advanceable_alignment_coordinate
const & rhs) noexcept
142 return std::tie(lhs.first, lhs.second) < std::tie(rhs.first, rhs.second);
145 constexpr
friend bool operator>=(advanceable_alignment_coordinate
const & lhs,
146 advanceable_alignment_coordinate
const & rhs) noexcept
148 return std::tie(lhs.first, lhs.second) >= std::tie(rhs.first, rhs.second);
151 constexpr
friend bool operator> (advanceable_alignment_coordinate
const & lhs,
152 advanceable_alignment_coordinate
const & rhs) noexcept
154 return std::tie(lhs.first, lhs.second) > std::tie(rhs.first, rhs.second);
168 constexpr advanceable_alignment_coordinate & operator++() noexcept
170 requires (state != advanceable_alignment_coordinate_state::
none)
173 if constexpr (state == advanceable_alignment_coordinate_state::column)
183 constexpr advanceable_alignment_coordinate operator++(
int ) noexcept
185 requires (state != advanceable_alignment_coordinate_state::none)
188 advanceable_alignment_coordinate tmp{*
this};
196 constexpr advanceable_alignment_coordinate & operator--() noexcept
198 requires (state != advanceable_alignment_coordinate_state::
none)
201 if constexpr (state == advanceable_alignment_coordinate_state::column)
211 constexpr advanceable_alignment_coordinate operator--(
int ) noexcept
213 requires (state != advanceable_alignment_coordinate_state::none)
216 advanceable_alignment_coordinate tmp{*
this};
225 constexpr advanceable_alignment_coordinate & operator+=(difference_type
const offset) noexcept
227 requires (state != advanceable_alignment_coordinate_state::none)
230 if constexpr (state == advanceable_alignment_coordinate_state::column)
241 constexpr advanceable_alignment_coordinate & operator-=(difference_type
const offset) noexcept
243 requires (state != advanceable_alignment_coordinate_state::none)
246 if constexpr (state == advanceable_alignment_coordinate_state::column)
257 constexpr advanceable_alignment_coordinate operator+(difference_type
const offset)
const noexcept
259 requires (state != advanceable_alignment_coordinate_state::none)
262 advanceable_alignment_coordinate tmp{*
this};
271 constexpr advanceable_alignment_coordinate operator-(difference_type
const offset)
const noexcept
273 requires (state != advanceable_alignment_coordinate_state::none)
276 advanceable_alignment_coordinate tmp{*
this};
285 constexpr difference_type operator-(advanceable_alignment_coordinate
const & other)
const noexcept
287 requires (state != advanceable_alignment_coordinate_state::none)
290 if constexpr (state == advanceable_alignment_coordinate_state::column)
291 return this->first - other.first;
293 return this->second - other.second;
303 constexpr
friend advanceable_alignment_coordinate operator+(difference_type
const offset,
304 advanceable_alignment_coordinate
const & me) noexcept
306 requires (state != advanceable_alignment_coordinate_state::none)
339 :
public detail::advanceable_alignment_coordinate<detail::advanceable_alignment_coordinate_state::none>
344 using base_t = detail::advanceable_alignment_coordinate<detail::advanceable_alignment_coordinate_state::none>;
361 using base_t::base_t;
374 using base_t::second;
383 constexpr
operator detail::matrix_coordinate()
const
385 return detail::matrix_coordinate{detail::row_index_type{
second}, detail::column_index_type{
first}};
399 template <
typename char_t,
typename coordinate_type>
401 requires std::same_as<std::remove_cvref_t<coordinate_type>, alignment_coordinate> ||
402 detail::is_value_specialisation_of_v<std::remove_cvref_t<coordinate_type>,
403 detail::advanceable_alignment_coordinate>
405 inline debug_stream_type<char_t> &
operator<<(debug_stream_type<char_t> & s, coordinate_type && c)
407 s << std::tie(c.first, c.second);
Represents the begin/end of the pairwise alignment in the respective sequences.
Definition: alignment_coordinate.hpp:341
size_t second
The begin/end position of the alignment in the second sequence.
Definition: alignment_coordinate.hpp:379
constexpr alignment_coordinate(alignment_coordinate &&)=default
Defaulted.
~alignment_coordinate()=default
Defaulted.
constexpr alignment_coordinate & operator=(alignment_coordinate const &)=default
Defaulted.
size_t first
The begin/end position of the alignment in the first sequence.
Definition: alignment_coordinate.hpp:377
constexpr alignment_coordinate(alignment_coordinate const &)=default
Defaulted.
constexpr alignment_coordinate()=default
Defaulted.
constexpr alignment_coordinate & operator=(alignment_coordinate &&)=default
Defaulted.
Provides seqan3::debug_stream and related types.
Provides seqan3::debug_stream and related types.
debug_stream_type< char_t > & operator<<(debug_stream_type< char_t > &stream, alignment_t &&alignment)
Stream operator for alignments, which are represented as tuples of aligned sequences.
Definition: debug_stream_alignment.hpp:103
@ offset
Sequence (SEQ) relative start position (0-based), unsigned value.
@ none
No flag is set.
Definition: debug_stream_type.hpp:30
auto const move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:68
Provides C++20 additions to the <iterator> header.
Provides seqan3::detail::alignment_coordinate and associated strong types.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
SeqAn specific customisations in the standard namespace.
Definition: affine_cell_proxy.hpp:154
Provides basic data structure for strong types.
Provides seqan3::type_list and auxiliary type traits.
Provides C++20 additions to the type_traits header.