55 template <
typename score_t,
typename coordinate_t>
56 requires (std::totally_ordered<score_t> && std::assignable_from<score_t &, score_t const &>
57 && std::assignable_from<coordinate_t &, coordinate_t const &>)
58 void operator()(score_t & optimal_score,
59 coordinate_t & optimal_coordinate,
60 score_t current_score,
61 coordinate_t current_coordinate)
const noexcept
63 bool const is_better_score = current_score >= optimal_score;
64 optimal_score = (is_better_score) ? std::move(current_score) : optimal_score;
65 optimal_coordinate = (is_better_score) ? std::move(current_coordinate) : optimal_coordinate;
135 template <
typename score_t,
typename coordinate_t>
136 requires (std::totally_ordered<score_t> && std::assignable_from<score_t &, score_t const &>
137 && std::assignable_from<coordinate_t &, coordinate_t const &>)
138 void operator()(score_t & optimal_score,
139 coordinate_t & optimal_coordinate,
140 score_t current_score,
141 coordinate_t current_coordinate)
const noexcept
143 bool const is_better_score =
145 && (current_score >= optimal_score);
146 optimal_score = (is_better_score) ? std::move(current_score) : optimal_score;
147 optimal_coordinate = (is_better_score) ? std::move(current_coordinate) : optimal_coordinate;
180template <
typename alignment_configuration_t, std::semiregular optimum_updater_t>
181 requires is_type_specialisation_of_v<alignment_configuration_t, configuration>
252 template <
typename cell_t>
258 return std::forward<cell_t>(cell);
275 template <
typename cell_t>
295 template <
typename cell_t>
301 return std::forward<cell_t>(cell);
318 template <
typename cell_t>
342 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:122
Implements the tracker to store the global optimum for a particular alignment computation.
Definition: policy_optimum_tracker.hpp:189
void reset_optimum() noexcept
Resets the optimum such that a new alignment can be computed.
Definition: policy_optimum_tracker.hpp:325
~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:230
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:343
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:319
bool test_last_row_cell
Whether cells of the last row shall be tracked.
Definition: policy_optimum_tracker.hpp:208
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:196
typename traits_type::score_type score_type
The configured score type.
Definition: policy_optimum_tracker.hpp:194
policy_optimum_tracker()=default
Defaulted.
score_type optimal_score
The tracked score of the global optimum.
Definition: policy_optimum_tracker.hpp:199
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:276
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:203
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:206
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:296
matrix_coordinate_type optimal_coordinate
The matrix coordinate of the tracked optimum.
Definition: policy_optimum_tracker.hpp:201
bool test_last_column_cell
Whether cells of the last column shall be tracked.
Definition: policy_optimum_tracker.hpp:210
decltype(auto) track_cell(cell_t &&cell, matrix_coordinate_type coordinate) noexcept
Tracks any cell within the alignment matrix.
Definition: policy_optimum_tracker.hpp:253
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:29
A traits type for the alignment algorithm that exposes static information stored within the alignment...
Definition: alignment/pairwise/detail/type_traits.hpp:83
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:136
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:146
A strong type for designated initialisation of the column index of a matrix.
Definition: matrix_coordinate.hpp:32
A function object that compares and possibly updates the alignment optimum with the current cell.
Definition: policy_optimum_tracker.hpp:110
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:154
size_t target_row_index
The row index indicating the last row of the alignment matrix.
Definition: policy_optimum_tracker.hpp:113
size_t target_col_index
The column index indicating the last column of the alignment matrix.
Definition: policy_optimum_tracker.hpp:115
A function object that compares and possibly updates the alignment optimum with the current cell.
Definition: policy_optimum_tracker.hpp:39
A strong type for designated initialisation of the row index of a matrix.
Definition: matrix_coordinate.hpp:61
Provides type traits for working with templates.
Provides seqan3::tuple_like.