15 #include <type_traits> 26 struct column_index_type : detail::strong_type<size_t, column_index_type>
29 using detail::strong_type<size_t, column_index_type>::strong_type;
34 struct row_index_type : detail::strong_type<size_t, row_index_type>
37 using detail::strong_type<size_t, row_index_type>::strong_type;
50 enum struct advanceable_alignment_coordinate_state : uint8_t
75 template <advanceable_alignment_coordinate_state state = advanceable_alignment_coordinate_state::none>
76 class advanceable_alignment_coordinate
91 constexpr advanceable_alignment_coordinate() noexcept = default;
92 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate const &) noexcept = default;
94 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate &&) noexcept = default;
95 constexpr advanceable_alignment_coordinate & operator=(advanceable_alignment_coordinate const &) noexcept = default;
98 constexpr advanceable_alignment_coordinate & operator=(advanceable_alignment_coordinate &&) noexcept = default;
99 ~advanceable_alignment_coordinate() noexcept = default;
102 template <advanceable_alignment_coordinate_state other_state>
104 requires !
std::Same<other_state, state>
106 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate<other_state> const & other) :
112 template <advanceable_alignment_coordinate_state other_state>
116 constexpr advanceable_alignment_coordinate(advanceable_alignment_coordinate<other_state> && other) :
117 first{std::move(other.first)},
118 second{std::move(other.second)}
125 constexpr advanceable_alignment_coordinate(column_index_type
const c_idx,
126 row_index_type
const r_idx) noexcept :
133 constexpr
friend bool operator==(advanceable_alignment_coordinate
const & lhs,
134 advanceable_alignment_coordinate
const & rhs) noexcept
139 constexpr
friend bool operator!=(advanceable_alignment_coordinate
const & lhs,
140 advanceable_alignment_coordinate
const & rhs) noexcept
145 constexpr
friend bool operator<=(advanceable_alignment_coordinate
const & lhs,
146 advanceable_alignment_coordinate
const & rhs) noexcept
151 constexpr
friend bool operator< (advanceable_alignment_coordinate
const & lhs,
152 advanceable_alignment_coordinate
const & rhs) noexcept
157 constexpr
friend bool operator>=(advanceable_alignment_coordinate
const & lhs,
158 advanceable_alignment_coordinate
const & rhs) noexcept
163 constexpr
friend bool operator> (advanceable_alignment_coordinate
const & lhs,
164 advanceable_alignment_coordinate
const & rhs) noexcept
180 constexpr advanceable_alignment_coordinate & operator++() noexcept
182 requires state != advanceable_alignment_coordinate_state::none
185 if constexpr (state == advanceable_alignment_coordinate_state::column)
195 constexpr advanceable_alignment_coordinate operator++(
int ) noexcept
197 requires state != advanceable_alignment_coordinate_state::none
200 advanceable_alignment_coordinate tmp{*
this};
208 constexpr advanceable_alignment_coordinate & operator--() noexcept
210 requires state != advanceable_alignment_coordinate_state::none
213 if constexpr (state == advanceable_alignment_coordinate_state::column)
223 constexpr advanceable_alignment_coordinate operator--(
int ) noexcept
225 requires state != advanceable_alignment_coordinate_state::none
228 advanceable_alignment_coordinate tmp{*
this};
237 constexpr advanceable_alignment_coordinate & operator+=(difference_type
const offset) noexcept
239 requires state != advanceable_alignment_coordinate_state::none
242 if constexpr (state == advanceable_alignment_coordinate_state::column)
243 this->first += offset;
245 this->second += offset;
253 constexpr advanceable_alignment_coordinate & operator-=(difference_type
const offset) noexcept
255 requires state != advanceable_alignment_coordinate_state::none
258 if constexpr (state == advanceable_alignment_coordinate_state::column)
259 this->first -= offset;
261 this->second -= offset;
269 constexpr advanceable_alignment_coordinate operator+(difference_type
const offset)
const noexcept
271 requires state != advanceable_alignment_coordinate_state::none
274 advanceable_alignment_coordinate tmp{*
this};
283 constexpr advanceable_alignment_coordinate operator-(difference_type
const offset)
const noexcept
285 requires state != advanceable_alignment_coordinate_state::none
288 advanceable_alignment_coordinate tmp{*
this};
297 constexpr difference_type operator-(advanceable_alignment_coordinate
const & other)
const noexcept
299 requires state != advanceable_alignment_coordinate_state::none
302 if constexpr (state == advanceable_alignment_coordinate_state::column)
303 return this->first - other.first;
305 return this->second - other.second;
315 constexpr
friend advanceable_alignment_coordinate operator+(difference_type
const offset,
316 advanceable_alignment_coordinate
const & me) noexcept
318 requires state != advanceable_alignment_coordinate_state::none
351 :
public detail::advanceable_alignment_coordinate<detail::advanceable_alignment_coordinate_state::none>
356 using base_t = detail::advanceable_alignment_coordinate<detail::advanceable_alignment_coordinate_state::none>;
373 using base_t::base_t;
386 using base_t::second;
404 template <
typename coordinate_type>
407 detail::is_value_specialisation_of_v<remove_cvref_t<coordinate_type>,
408 detail::advanceable_alignment_coordinate>
size_t second
The begin/end position of the alignment in the second sequence.
Definition: alignment_coordinate.hpp:391
Provides basic data structure for strong types.
debug_stream_type & operator<<(debug_stream_type &s, coordinate_type &&c)
A seqan3::alignment_coordinate can be printed to the seqan3::debug_stream.
Definition: alignment_coordinate.hpp:410
constexpr alignment_coordinate & operator=(alignment_coordinate const &)=default
Defaulted.
Represents the begin/end of the pairwise alignment in the respective sequences.
Definition: alignment_coordinate.hpp:349
Provides C++20 additions to the <iterator> header.
SeqAn specific customisations in the standard namespace.
No flag is set.
Definition: debug_stream.hpp:39
The main SeqAn3 namespace.
size_t first
The begin/end position of the alignment in the first sequence.
Definition: alignment_coordinate.hpp:389
bool operator!=(type const &lhs, type const &rhs)
(In-)Equality comparison.
bool operator==(type const &lhs, type const &rhs)
(In-)Equality comparison.
~alignment_coordinate()=default
Defaulted.
Definition: aligned_sequence_concept.hpp:35
constexpr alignment_coordinate()=default
Defaulted.
The concept std::Same<T, U> is satisfied if and only if T and U denote the same type.
A "pretty printer" for most SeqAn data structures and related types.
Definition: debug_stream.hpp:78
Provides seqan3::debug_stream and related types.