25 namespace seqan3::detail
39 enum struct advanceable_alignment_coordinate_state : uint8_t
64 template <advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
65 class advanceable_alignment_coordinate
74 using difference_type = std::make_signed_t<size_t>;
80 constexpr advanceable_alignment_coordinate() noexcept = default;
82 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate const &) noexcept = default;
83 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate &&) noexcept = default;
85 constexpr advanceable_alignment_coordinate & operator=(advanceable_alignment_coordinate const &) noexcept = default;
87 constexpr advanceable_alignment_coordinate & operator=(advanceable_alignment_coordinate &&) noexcept = default;
88 ~advanceable_alignment_coordinate() noexcept = default;
91 template <advanceable_alignment_coordinate_state other_state>
93 requires (other_state != state)
95 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate<other_state> const & other) :
101 template <advanceable_alignment_coordinate_state other_state>
103 requires (other_state != state)
105 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate<other_state> && other) :
106 first{
std::move(other.first)},
107 second{
std::move(other.second)}
114 constexpr advanceable_alignment_coordinate(column_index_type<size_t>
const c_idx,
115 row_index_type<size_t>
const r_idx) noexcept :
122 constexpr
friend bool operator==(advanceable_alignment_coordinate
const & lhs,
123 advanceable_alignment_coordinate
const & rhs) noexcept
125 return std::tie(lhs.first, lhs.second) == std::tie(rhs.first, rhs.second);
128 constexpr
friend bool operator!=(advanceable_alignment_coordinate
const & lhs,
129 advanceable_alignment_coordinate
const & rhs) noexcept
131 return std::tie(lhs.first, lhs.second) != std::tie(rhs.first, rhs.second);
134 constexpr
friend bool operator<=(advanceable_alignment_coordinate
const & lhs,
135 advanceable_alignment_coordinate
const & rhs) noexcept
137 return std::tie(lhs.first, lhs.second) <= std::tie(rhs.first, rhs.second);
140 constexpr
friend bool operator< (advanceable_alignment_coordinate
const & lhs,
141 advanceable_alignment_coordinate
const & rhs) noexcept
143 return std::tie(lhs.first, lhs.second) < std::tie(rhs.first, rhs.second);
146 constexpr
friend bool operator>=(advanceable_alignment_coordinate
const & lhs,
147 advanceable_alignment_coordinate
const & rhs) noexcept
149 return std::tie(lhs.first, lhs.second) >= std::tie(rhs.first, rhs.second);
152 constexpr
friend bool operator> (advanceable_alignment_coordinate
const & lhs,
153 advanceable_alignment_coordinate
const & rhs) noexcept
155 return std::tie(lhs.first, lhs.second) > std::tie(rhs.first, rhs.second);
169 constexpr advanceable_alignment_coordinate & operator++() noexcept
171 requires (state != advanceable_alignment_coordinate_state::
none)
174 if constexpr (state == advanceable_alignment_coordinate_state::column)
184 constexpr advanceable_alignment_coordinate operator++(
int ) noexcept
186 requires (state != advanceable_alignment_coordinate_state::none)
189 advanceable_alignment_coordinate tmp{*
this};
197 constexpr advanceable_alignment_coordinate & operator--() noexcept
199 requires (state != advanceable_alignment_coordinate_state::
none)
202 if constexpr (state == advanceable_alignment_coordinate_state::column)
212 constexpr advanceable_alignment_coordinate operator--(
int ) noexcept
214 requires (state != advanceable_alignment_coordinate_state::none)
217 advanceable_alignment_coordinate tmp{*
this};
226 constexpr advanceable_alignment_coordinate & operator+=(difference_type
const offset) noexcept
228 requires (state != advanceable_alignment_coordinate_state::none)
231 if constexpr (state == advanceable_alignment_coordinate_state::column)
242 constexpr advanceable_alignment_coordinate & operator-=(difference_type
const offset) noexcept
244 requires (state != advanceable_alignment_coordinate_state::none)
247 if constexpr (state == advanceable_alignment_coordinate_state::column)
258 constexpr advanceable_alignment_coordinate operator+(difference_type
const offset)
const noexcept
260 requires (state != advanceable_alignment_coordinate_state::none)
263 advanceable_alignment_coordinate tmp{*
this};
272 constexpr advanceable_alignment_coordinate operator-(difference_type
const offset)
const noexcept
274 requires (state != advanceable_alignment_coordinate_state::none)
277 advanceable_alignment_coordinate tmp{*
this};
286 constexpr difference_type operator-(advanceable_alignment_coordinate
const & other)
const noexcept
288 requires (state != advanceable_alignment_coordinate_state::none)
291 if constexpr (state == advanceable_alignment_coordinate_state::column)
292 return this->first - other.first;
294 return this->second - other.second;
304 constexpr
friend advanceable_alignment_coordinate operator+(difference_type
const offset,
305 advanceable_alignment_coordinate
const & me) noexcept
307 requires (state != advanceable_alignment_coordinate_state::none)
335 template <
typename char_t,
typename coordinate_type>
337 requires detail::is_value_specialisation_of_v<std::remove_cvref_t<coordinate_type>,
338 detail::advanceable_alignment_coordinate>
340 inline debug_stream_type<char_t> &
operator<<(debug_stream_type<char_t> & s, coordinate_type && c)
342 s << std::tie(c.first, c.second);
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:101
@ none
No flag is set.
Definition: debug_stream_type.hpp:32
@ offset
Sequence (seqan3::field::seq) relative start position (0-based), unsigned value.
Provides C++20 additions to the <iterator> header.
Provides seqan3::detail::matrix_index, seqan3::detail::matrix_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:438
Provides basic data structure for strong types.
Provides type traits for working with templates.
Provides seqan3::debug_stream and related types.
Provides C++20 additions to the type_traits header.