|
SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
|
Implements the tracker to store the global optimum for a particular alignment computation. More...
#include <seqan3/alignment/pairwise/detail/policy_optimum_tracker.hpp>
Inheritance diagram for seqan3::detail::policy_optimum_tracker< alignment_configuration_t, optimum_updater_t >:Protected Types | |
| using | matrix_coordinate_type = typename traits_type::matrix_coordinate_type |
| The matrix coordinate type that is used to locate a cell inside of the alignment matrix. | |
| using | score_type = typename traits_type::score_type |
| The configured score type. | |
| using | traits_type = alignment_configuration_traits< alignment_configuration_t > |
| The configuration traits type. | |
Protected Member Functions | |
| template<typename cell_t > | |
| void | invoke_comparator (cell_t &&cell, matrix_coordinate_type coordinate) noexcept |
| Handles the invocation of the optimum comparator and updater. | |
| void | reset_optimum () noexcept |
| Resets the optimum such that a new alignment can be computed. | |
| template<typename cell_t > | |
| decltype(auto) | track_cell (cell_t &&cell, matrix_coordinate_type coordinate) noexcept |
| Tracks any cell within the alignment matrix. | |
| template<typename cell_t > | |
| decltype(auto) | track_final_cell (cell_t &&cell, matrix_coordinate_type coordinate) noexcept |
| Tracks the final cell of the alignment matrix. | |
| template<typename cell_t > | |
| 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. | |
| template<typename cell_t > | |
| 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. | |
Constructors, destructor and assignment | |
| policy_optimum_tracker ()=default | |
| Defaulted. | |
| policy_optimum_tracker (policy_optimum_tracker const &)=default | |
| Defaulted. | |
| policy_optimum_tracker (policy_optimum_tracker &&)=default | |
| Defaulted. | |
| policy_optimum_tracker & | operator= (policy_optimum_tracker const &)=default |
| Defaulted. | |
| policy_optimum_tracker & | operator= (policy_optimum_tracker &&)=default |
| Defaulted. | |
| ~policy_optimum_tracker ()=default | |
| Defaulted. | |
| policy_optimum_tracker (alignment_configuration_t const &config) | |
| Construction and initialisation using the alignment configuration. | |
Protected Attributes | |
| optimum_updater_t | compare_and_set_optimum {} |
| The function object to compare and exchange the optimum. | |
| matrix_coordinate_type | optimal_coordinate {} |
| The matrix coordinate of the tracked optimum. | |
| score_type | optimal_score {} |
| The tracked score of the global optimum. | |
| bool | test_every_cell {false} |
| Whether every cell of the alignment matrix shall be tracked. | |
| bool | test_last_column_cell {false} |
| Whether cells of the last column shall be tracked. | |
| bool | test_last_row_cell {false} |
| Whether cells of the last row shall be tracked. | |
Implements the tracker to store the global optimum for a particular alignment computation.
| alignment_configuration_t | The type of the alignment configuration; must be a type specialisation of seqan3::configuration. |
| optimum_updater_t | The type of the optimum update operation, which compares and updates the alignment optimum with the current cell; must model std::semiregular. |
Implements the interface to track the alignment optimum. It updates the currently stored optimum using the optimum update operation. The optimum update operation is stored inside of the class and can have a state. The optimum updater must be invokable with a reference to the optimal score and coordinate and the score and coordinate of the current cell. Special methods are offered to track any cell (for example when computing the local alignment), the last cell of a column or a row (for example when using free-end gaps), or the final cell of the entire matrix (for example in the standard global alignment). The optimum needs to be reset in between alignment computations in order to ensure that the correct result is tracked.
|
inlineprotected |
Construction and initialisation using the alignment configuration.
| [in] | config | The alignment configuration (not used in this context). |
Reads the state of seqan3::align_cfg::method_global and enables the tracking of the last row or column if requested. Otherwise, only the last cell will be tracked.
|
inlineprotectednoexcept |
Handles the invocation of the optimum comparator and updater.
| cell_t | The cell type of the alignment matrix; must have a member function best_score(). |
| [in] | cell | The current cell to be tracked. |
| [in] | coordinate | The matrix coordinate of the current cell. |
Forwards the score and coordinate pair as a tuple and invokes the compare and set operation with the so far best score/coordinate pair and the current score/coordinate pair.
|
inlineprotectednoexcept |
Tracks any cell within the alignment matrix.
| cell_t | The cell type of the alignment matrix; must have a member function best_score(). |
| [in] | cell | The current cell to be tracked. |
| [in] | coordinate | The matrix coordinate of the current cell. |
A call to this function only tracks the optimal score of the given cell if the configuration of the alignment algorithm requires it, for example when a local alignment shall be computed.
|
inlineprotectednoexcept |
Tracks the final cell of the alignment matrix.
| cell_t | The cell type of the alignment matrix; must have a member function best_score(). |
| [in] | cell | The current cell to be tracked. |
| [in] | coordinate | The matrix coordinate of the current cell. |
A call to this function only tracks the optimal score of the given cell if the configuration of the alignment algorithm requires it, for example when a global alignment shall be computed.
|
inlineprotectednoexcept |
Tracks the last cell of a column within the alignment matrix.
| cell_t | The cell type of the alignment matrix; must have a member function best_score(). |
| [in] | cell | The current cell to be tracked. |
| [in] | coordinate | The matrix coordinate of the current cell. |
A call to this function only tracks the optimal score of the given cell if the configuration of the alignment algorithm requires it, for example when a semi-global alignment shall be computed.
|
inlineprotectednoexcept |
Tracks the last cell of a row within the alignment matrix.
| cell_t | The cell type of the alignment matrix; must have a member function best_score(). |
| [in] | cell | The current cell to be tracked. |
| [in] | coordinate | The matrix coordinate of the current cell. |
A call to this function only tracks the optimal score of the given cell if the configuration of the alignment algorithm requires it, for example when a semi-global alignment shall be computed.