44template <std::ranges::input_range score_matrix_t, std::ranges::input_range trace_matrix_t>
45 requires (std::ranges::input_range<std::ranges::range_reference_t<score_matrix_t>>
46 && std::ranges::input_range<std::ranges::range_reference_t<trace_matrix_t>>)
57 score_matrix_t score_matrix{};
59 trace_matrix_t trace_matrix{};
94 template <std::
integral column_index_t, std::
integral row_index_t>
99 score_matrix_t tmp_score_matrix{};
100 tmp_score_matrix.resize(column_count, row_count, initial_score);
102 trace_matrix_t tmp_trace_matrix{};
103 tmp_trace_matrix.resize(column_count, row_count);
105 score_matrix = std::move(tmp_score_matrix);
106 trace_matrix = std::move(tmp_trace_matrix);
115 return iterator{score_matrix.begin(), trace_matrix.begin()};
124 return sentinel{score_matrix.end()};
139 auto trace_path(matrix_coordinate
const & from_coordinate)
const
141 return trace_matrix.trace_path(from_coordinate);
156template <std::ranges::input_range score_matrix_t, std::ranges::input_range trace_matrix_t>
157 requires (std::ranges::input_range<std::ranges::range_reference_t<score_matrix_t>>
158 && std::ranges::input_range<std::ranges::range_reference_t<trace_matrix_t>>)
167 static_assert(std::ranges::viewable_range<score_matrix_reference_type>);
168 static_assert(std::ranges::viewable_range<trace_matrix_reference_type>);
172 decltype(
views::zip(std::declval<score_matrix_reference_type>(), std::declval<trace_matrix_reference_type>()));
179 template <std::ranges::input_range other_score_matrix_t, std::ranges::input_range other_trace_matrix_t>
180 requires (std::ranges::input_range<std::ranges::range_reference_t<other_score_matrix_t>>
181 && std::ranges::input_range<std::ranges::range_reference_t<other_trace_matrix_t>>)
188 using fwd_tuple_t =
decltype(tpl);
202 using value_type =
decltype(std::declval<combined_column_type>() | transform_to_combined_matrix_cell);
229 score_matrix_it{std::move(score_matrix_it)},
230 trace_matrix_it{std::move(trace_matrix_it)}
240 return views::zip(*score_matrix_it, *trace_matrix_it) | transform_to_combined_matrix_cell;
270template <std::ranges::input_range score_matrix_t, std::ranges::input_range trace_matrix_t>
271 requires (std::ranges::input_range<std::ranges::range_reference_t<score_matrix_t>>
272 && std::ranges::input_range<std::ranges::range_reference_t<trace_matrix_t>>)
298 score_matrix_sentinel{std::move(score_matrix_sentinel)}
308 return rhs.equal(lhs);
320 return !(lhs == rhs);
326 return !(lhs == rhs);
342 return iter.score_matrix_it == score_matrix_sentinel;
Provides seqan3::detail::affine_cell_proxy.
A proxy for an affine score matrix cell.
Definition: affine_cell_proxy.hpp:117
Combined score and trace matrix iterator for the pairwise sequence alignment.
Definition: combined_score_and_trace_matrix.hpp:160
void operator++(int)
Advance the iterator to the next alignment matrix column.
Definition: combined_score_and_trace_matrix.hpp:256
iterator(iterator const &)=default
Defaulted.
std::ranges::iterator_t< trace_matrix_t > trace_matrix_iter_type
The type of the trace matrix iterator.
Definition: combined_score_and_trace_matrix.hpp:176
iterator & operator=(iterator &&)=default
Defaulted.
iterator & operator++()
Advance the iterator to the next alignment matrix column.
Definition: combined_score_and_trace_matrix.hpp:248
value_type reference
The reference type.
Definition: combined_score_and_trace_matrix.hpp:204
reference operator*() const
Returns the range over the current column.
Definition: combined_score_and_trace_matrix.hpp:238
void pointer
The pointer type.
Definition: combined_score_and_trace_matrix.hpp:206
std::ranges::range_reference_t< score_matrix_t > score_matrix_reference_type
The reference type of the score matrix.
Definition: combined_score_and_trace_matrix.hpp:163
iterator & operator=(iterator const &)=default
Defaulted.
iterator(iterator &&)=default
Defaulted.
iterator()=default
Defaulted.
decltype(std::declval< combined_column_type >()|transform_to_combined_matrix_cell) value_type
The value type.
Definition: combined_score_and_trace_matrix.hpp:202
score_matrix_iter_type score_matrix_it
The current iterator over the score matrix.
Definition: combined_score_and_trace_matrix.hpp:193
std::ranges::iterator_t< score_matrix_t > score_matrix_iter_type
The type of the score matrix iterator.
Definition: combined_score_and_trace_matrix.hpp:174
iterator(score_matrix_iter_type score_matrix_it, trace_matrix_iter_type trace_matrix_it) noexcept
Initialises the iterator from the underlying matrix.
Definition: combined_score_and_trace_matrix.hpp:228
std::ranges::range_reference_t< trace_matrix_t > trace_matrix_reference_type
The reference type of the trace matrix.
Definition: combined_score_and_trace_matrix.hpp:165
~iterator()=default
Defaulted.
trace_matrix_iter_type trace_matrix_it
The current iterator over the trace matrix.
Definition: combined_score_and_trace_matrix.hpp:195
decltype(views::zip(std::declval< score_matrix_reference_type >(), std::declval< trace_matrix_reference_type >())) combined_column_type
The combined column type.
Definition: combined_score_and_trace_matrix.hpp:172
The sentinel type for the seqan3::detail::combined_score_and_trace_matrix.
Definition: combined_score_and_trace_matrix.hpp:274
friend bool operator==(iterator const &lhs, sentinel const &rhs) noexcept
Checks if the iterator reached the end of the matrix.
Definition: combined_score_and_trace_matrix.hpp:306
friend bool operator!=(iterator const &lhs, sentinel const &rhs) noexcept
Checks if the iterator did not reach the end of the matrix.
Definition: combined_score_and_trace_matrix.hpp:318
~sentinel()=default
Defaulted.
constexpr bool equal(iterator const &iter) const noexcept
Compares the stored score matrix sentinel with the given iterator.
Definition: combined_score_and_trace_matrix.hpp:340
friend bool operator!=(sentinel const &lhs, iterator const &rhs) noexcept
Checks if the iterator did not reach the end of the matrix.
Definition: combined_score_and_trace_matrix.hpp:324
sentinel(sentinel &&)=default
Defaulted.
sentinel & operator=(sentinel const &)=default
Defaulted.
friend bool operator==(sentinel const &lhs, iterator const &rhs) noexcept
Checks if the iterator reached the end of the matrix.
Definition: combined_score_and_trace_matrix.hpp:312
sentinel(sentinel const &)=default
Defaulted.
sentinel(score_matrix_sentinel_type score_matrix_sentinel) noexcept
Initialises the sentinel from the underlying matrix.
Definition: combined_score_and_trace_matrix.hpp:297
sentinel & operator=(sentinel &&)=default
Defaulted.
std::ranges::sentinel_t< score_matrix_t > score_matrix_sentinel_type
The sentinel type of the underlying score matrix.
Definition: combined_score_and_trace_matrix.hpp:277
sentinel()=default
Defaulted.
An alignment matrix that combines a score matrix with a trace matrix into a common interface.
Definition: combined_score_and_trace_matrix.hpp:48
sentinel end() const =delete
This alignment matrix is not const-iterable.
auto trace_path(matrix_coordinate const &from_coordinate) const
Returns a trace path starting from the given coordinate and ending in the cell with seqan3::detail::t...
Definition: combined_score_and_trace_matrix.hpp:139
combined_score_and_trace_matrix & operator=(combined_score_and_trace_matrix const &)=default
Defaulted.
void resize(column_index_type< column_index_t > const column_count, row_index_type< row_index_t > const row_count, score_type const initial_score=score_type{})
Resizes the matrix.
Definition: combined_score_and_trace_matrix.hpp:95
~combined_score_and_trace_matrix()=default
Defaulted.
combined_score_and_trace_matrix()=default
Defaulted.
combined_score_and_trace_matrix(combined_score_and_trace_matrix &&)=default
Defaulted.
iterator begin()
Returns the iterator pointing to the first alignment column.
Definition: combined_score_and_trace_matrix.hpp:113
combined_score_and_trace_matrix & operator=(combined_score_and_trace_matrix &&)=default
Defaulted.
combined_score_and_trace_matrix(combined_score_and_trace_matrix const &)=default
Defaulted.
iterator begin() const =delete
This score matrix is not const-iterable.
sentinel end()
Returns the sentinel pointing behind the last alignment column.
Definition: combined_score_and_trace_matrix.hpp:122
Provides various transformation traits used by the range module.
decltype(detail::transform< trait_t >(list_t{})) transform
Apply a transformation trait to every type in the list and return a seqan3::type_list of the results.
Definition: type_list/traits.hpp:470
constexpr auto zip
A view adaptor that takes several views and returns tuple-like values from every i-th element of each...
Definition: zip.hpp:573
Provides seqan3::detail::matrix_index, seqan3::detail::matrix_coordinate and associated strong types.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
A strong type for designated initialisation of the column index of a matrix.
Definition: matrix_coordinate.hpp:32
A strong type for designated initialisation of the row index of a matrix.
Definition: matrix_coordinate.hpp:61
Provides concepts that do not have equivalents in C++20.
Provides seqan3::views::zip.