52 template <
typename score_t,
typename coordinate_t>
53 requires (std::totally_ordered<score_t> && std::assignable_from<score_t &, score_t const &>
54 && std::assignable_from<coordinate_t &, coordinate_t const &>)
55 void operator()(score_t & optimal_score,
56 coordinate_t & optimal_coordinate,
57 score_t current_score,
58 coordinate_t current_coordinate)
const noexcept
60 bool const is_better_score = current_score >= optimal_score;
61 optimal_score = (is_better_score) ? std::move(current_score) : optimal_score;
62 optimal_coordinate = (is_better_score) ? std::move(current_coordinate) : optimal_coordinate;
132 template <
typename score_t,
typename coordinate_t>
133 requires (std::totally_ordered<score_t> && std::assignable_from<score_t &, score_t const &>
134 && std::assignable_from<coordinate_t &, coordinate_t const &>)
135 void operator()(score_t & optimal_score,
136 coordinate_t & optimal_coordinate,
137 score_t current_score,
138 coordinate_t current_coordinate)
const noexcept
140 bool const is_better_score =
142 && (current_score >= optimal_score);
143 optimal_score = (is_better_score) ? std::move(current_score) : optimal_score;
144 optimal_coordinate = (is_better_score) ? std::move(current_coordinate) : optimal_coordinate;
177template <
typename alignment_configuration_t, std::semiregular optimum_updater_t>
178 requires is_type_specialisation_of_v<alignment_configuration_t, configuration>
249 template <
typename cell_t>
255 return std::forward<cell_t>(cell);
272 template <
typename cell_t>
292 template <
typename cell_t>
298 return std::forward<cell_t>(cell);
315 template <
typename cell_t>
339 template <
typename cell_t>
Provides helper type traits for the configuration and execution of the alignment algorithm.
Sets the global alignment method.
Definition align_config_method.hpp:119
Implements the tracker to store the global optimum for a particular alignment computation.
Definition policy_optimum_tracker.hpp:186
void reset_optimum() noexcept
Resets the optimum such that a new alignment can be computed.
Definition policy_optimum_tracker.hpp:322
~policy_optimum_tracker()=default
Defaulted.
policy_optimum_tracker(alignment_configuration_t const &config)
Construction and initialisation using the alignment configuration.
Definition policy_optimum_tracker.hpp:227
policy_optimum_tracker & operator=(policy_optimum_tracker const &)=default
Defaulted.
void invoke_comparator(cell_t &&cell, matrix_coordinate_type coordinate) noexcept
Handles the invocation of the optimum comparator and updater.
Definition policy_optimum_tracker.hpp:340
decltype(auto) track_final_cell(cell_t &&cell, matrix_coordinate_type coordinate) noexcept
Tracks the final cell of the alignment matrix.
Definition policy_optimum_tracker.hpp:316
bool test_last_row_cell
Whether cells of the last row shall be tracked.
Definition policy_optimum_tracker.hpp:205
typename traits_type::matrix_coordinate_type matrix_coordinate_type
The matrix coordinate type that is used to locate a cell inside of the alignment matrix.
Definition policy_optimum_tracker.hpp:193
typename traits_type::score_type score_type
The configured score type.
Definition policy_optimum_tracker.hpp:191
policy_optimum_tracker()=default
Defaulted.
score_type optimal_score
The tracked score of the global optimum.
Definition policy_optimum_tracker.hpp:196
decltype(auto) track_last_row_cell(cell_t &&cell, matrix_coordinate_type coordinate) noexcept
Tracks the last cell of a row within the alignment matrix.
Definition policy_optimum_tracker.hpp:273
policy_optimum_tracker & operator=(policy_optimum_tracker &&)=default
Defaulted.
optimum_updater_t compare_and_set_optimum
The function object to compare and exchange the optimum.
Definition policy_optimum_tracker.hpp:200
policy_optimum_tracker(policy_optimum_tracker &&)=default
Defaulted.
bool test_every_cell
Whether every cell of the alignment matrix shall be tracked.
Definition policy_optimum_tracker.hpp:203
decltype(auto) track_last_column_cell(cell_t &&cell, matrix_coordinate_type coordinate) noexcept
Tracks the last cell of a column within the alignment matrix.
Definition policy_optimum_tracker.hpp:293
matrix_coordinate_type optimal_coordinate
The matrix coordinate of the tracked optimum.
Definition policy_optimum_tracker.hpp:198
bool test_last_column_cell
Whether cells of the last column shall be tracked.
Definition policy_optimum_tracker.hpp:207
decltype(auto) track_cell(cell_t &&cell, matrix_coordinate_type coordinate) noexcept
Tracks any cell within the alignment matrix.
Definition policy_optimum_tracker.hpp:250
policy_optimum_tracker(policy_optimum_tracker const &)=default
Defaulted.
Provides seqan3::configuration and utility functions.
Provides seqan3::detail::coordinate_matrix.
Provides seqan3::detail::matrix_index, seqan3::detail::matrix_coordinate and associated strong types.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
A traits type for the alignment algorithm that exposes static information stored within the alignment...
Definition alignment/pairwise/detail/type_traits.hpp:80
std::conditional_t< is_vectorised, simd_type_t< original_score_type >, original_score_type > score_type
The score type for the alignment algorithm.
Definition alignment/pairwise/detail/type_traits.hpp:133
lazy_conditional_t< is_vectorised, lazy< simd_matrix_coordinate, matrix_index_type >, matrix_coordinate > matrix_coordinate_type
The type of the matrix coordinate.
Definition alignment/pairwise/detail/type_traits.hpp:143
A strong type for designated initialisation of the column index of a matrix.
Definition matrix_coordinate.hpp:29
A function object that compares and possibly updates the alignment optimum with the current cell.
Definition policy_optimum_tracker.hpp:107
void set_target_indices(row_index_type< size_t > row_index, column_index_type< size_t > col_index) noexcept
Sets the target index for the last row and column of the matrix.
Definition policy_optimum_tracker.hpp:151
size_t target_row_index
The row index indicating the last row of the alignment matrix.
Definition policy_optimum_tracker.hpp:110
size_t target_col_index
The column index indicating the last column of the alignment matrix.
Definition policy_optimum_tracker.hpp:112
A function object that compares and possibly updates the alignment optimum with the current cell.
Definition policy_optimum_tracker.hpp:36
A strong type for designated initialisation of the row index of a matrix.
Definition matrix_coordinate.hpp:58
Provides type traits for working with templates.
Provides seqan3::tuple_like.