SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
Function object that compares and updates the alignment optimum for the vectorised global alignment algorithm. More...
#include <seqan3/alignment/pairwise/detail/policy_optimum_tracker_simd.hpp>
Public Member Functions | |
template<typename score_t , typename coordinate_t > requires (std::assignable_from<score_t &, score_t const &> && requires (coordinate_t coordinate) { requires simd_concept<decltype(coordinate.col)>; requires simd_concept<decltype(coordinate.row)>; }) | |
void | operator() (score_t &optimal_score, coordinate_t const &optimal_coordinate, score_t current_score, coordinate_t const ¤t_coordinate) const noexcept |
Compares and updates the optimal score-coordinate pair. | |
Function object that compares and updates the alignment optimum for the vectorised global alignment algorithm.
This operation is specific to the global alignment in vectorised mode. The tracking of the last cells of the different alignment matrices that are computed simultaneously in one vector unit depends on how the scoring of the global alignment works. Any alignment matrix that is smaller than the largest matrix defined by the longest sequence in the collection of the first sequences and in the collection of the second sequences, will have its last cell in the middle of the encompassing matrix. In order to track this cell without checking every cell of the alignment matrix for the correct coordinate, the last cell of every contained matrix is projected along its diagonal to either the last row or the last column of the encompassing matrix. Within the algorithm only the cells of the last row, respectively column are tracked. Since the cells to track are fixed, the respective coordinates for every contained matrix can be precomputed. Subsequently, within this update operation the score is only updated if the coordinate of the current cell compares equal to the precomputed coordinate of any of the contained matrices.
|
inlinenoexcept |
Compares and updates the optimal score-coordinate pair.
score_t | The type of the score to track; must model std::assignable_from const & score_t . |
coordinate_t | The type of the coordinate to track; must be a seqan3::matrix_index type with members that model seqan3::simd::simd_concept. |
[in,out] | optimal_score | The optimal score to update. |
[in,out] | optimal_coordinate | The optimal coordinate to update. |
[in] | current_score | The score of the current cell. |
[in] | current_coordinate | The coordinate of the current cell. |
Compares the coordinate of the current cell with the precomputed coordinate which represent the projected last cells of the contained matrices. If a coordinate matches the precomputed one, then the respective score will be set for the optimal score.