|
SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
|
This algorithm unifies different edit distance implementations and uses the appropriate one depending on the given configuration. More...
#include <seqan3/alignment/pairwise/edit_distance_algorithm.hpp>
Inheritance diagram for seqan3::detail::edit_distance_algorithm< config_t, traits_t >:Private Types | |
| using | alignment_result_type = typename configuration_traits_type::alignment_result_type |
| The configured alignment result type. | |
| using | configuration_traits_type = alignment_configuration_traits< config_t > |
| The configuration traits for the selected alignment algorithm. | |
Constructors, destructor and assignment | |
| std::shared_ptr< std::remove_cvref_t< config_t > > | cfg_ptr {} |
| The alignment configuration stored on the heap. | |
| constexpr | edit_distance_algorithm ()=default |
| Defaulted. | |
| constexpr | edit_distance_algorithm (edit_distance_algorithm const &)=default |
| Defaulted. | |
| constexpr | edit_distance_algorithm (edit_distance_algorithm &&)=default |
| Defaulted. | |
| constexpr edit_distance_algorithm & | operator= (edit_distance_algorithm const &)=default |
| Defaulted. | |
| constexpr edit_distance_algorithm & | operator= (edit_distance_algorithm &&)=default |
| Defaulted. | |
| ~edit_distance_algorithm ()=default | |
| Defaulted. | |
| constexpr | edit_distance_algorithm (config_t const &cfg) |
| Constructs the wrapper with the passed configuration. | |
| template<indexed_sequence_pair_range indexed_sequence_pairs_t, typename callback_t > requires std::invocable<callback_t, alignment_result_type> | |
| constexpr void | operator() (indexed_sequence_pairs_t &&indexed_sequence_pairs, callback_t &&callback) |
| } | |
| template<std::ranges::forward_range first_range_t, std::ranges::forward_range second_range_t, typename callback_t > | |
| constexpr void | compute_single_pair (size_t const idx, first_range_t &&first_range, second_range_t &&second_range, callback_t &&callback) |
| Invokes the actual alignment computation for a single pair of sequences. | |
This algorithm unifies different edit distance implementations and uses the appropriate one depending on the given configuration.
| config_t | The configuration type. |
| traits_t | The traits type. |
This wrapper class is used to decouple the sequence types from the algorithm class type. Within the alignment configuration a std::function object storing this wrapper is returned if an edit distance should be computed. On invocation it delegates the call to the actual implementation of the edit distance algorithm, while the interface is unified with the execution model of the pairwise alignment algorithms.
|
inlineconstexpr |
Constructs the wrapper with the passed configuration.
| cfg | The configuration to be passed to the algorithm. |
The configuration is copied once to the heap during construction and maintained by a std::shared_ptr. The configuration is not passed to the function-call-operator of this function object in order to avoid incompatible configurations between the passed configuration and the one used during configuration of this class. Further, the function object will be stored in a std::function which requires copyable objects and in parallel executions the function object must be copied as well.
|
inlineconstexprprivate |
Invokes the actual alignment computation for a single pair of sequences.
| first_range_t | The type of the first sequence (or packed sequences); must model std::ranges::forward_range. |
| second_range_t | The type of the second sequence (or packed sequences); must model std::ranges::forward_range. |
| callback_t | The callback to call on the computed alignment result. |
| [in] | idx | The index of the current sequence pair. |
| [in] | first_range | The first sequence (or packed sequences). |
| [in] | second_range | The second sequence (or packed sequences). |
| [in] | callback | The callback to invoke on an alignment result. |
|
inlineconstexpr |
}
Invokes the alignment computation for every indexed sequence pair contained in the given range.
| indexed_sequence_pairs_t | The type of the range of the indexed sequence pairs; must model seqan3::detail::indexed_sequence_pairs. |
| callback_t | The type of the callback function that is called with the alignment result; must model std::invocable accepting one argument of type seqan3::alignment_result. |
| [in] | indexed_sequence_pairs | The indexed sequence pairs to align. |
| [in] | callback | The callback function to be invoked with the alignment result; must model std::invocable with the respective seqan3::alignment_result type. |
Computes for each contained sequence pair the respective alignment and invokes the given callback for each alignment result.