42template <
typename alignment_algorithm_t,
typename score_t,
typename align_local_t = std::false_type>
64 template <typename configuration_t>
82 template <
typename cell_t>
88 auto & [score_cell, trace_cell] = current_cell;
91 score_t tmp = score_cell.diagonal + score;
93 if constexpr (with_trace)
95 tmp = (tmp < score_cell.up) ? (trace_cell.current = trace_cell.up, score_cell.up)
97 tmp = (tmp < score_cell.r_left)
100 : (trace_cell.current |= trace_cell.r_left, tmp);
104 tmp = (tmp < score_cell.up) ? score_cell.up : tmp;
105 tmp = (tmp < score_cell.r_left) ? score_cell.r_left : tmp;
108 if constexpr (align_local_t::value)
112 score_cell.current = tmp;
117 tmp += cache.gap_open_score;
118 score_cell.up += cache.gap_extension_score;
119 score_cell.w_left = score_cell.r_left + cache.gap_extension_score;
140 template <
typename cell_t>
143 score_t
const score)
const noexcept
148 auto & [score_cell, trace_cell] = current_cell;
149 score_cell.current = score_cell.diagonal + score;
151 score_cell.current = (score_cell.current < score_cell.r_left)
152 ? (trace_cell.current = trace_cell.r_left, score_cell.r_left)
155 if constexpr (align_local_t::value)
165 score_cell.up = score_cell.current + cache.gap_open_score;
181 template <
typename alignment_configuration_t>
Provides seqan3::align_config::gap_cost_affine.
Provides seqan3::detail::alignment_algorithm_state.
A configuration element for the affine gap cost scheme.
Definition align_config_gap_cost_affine.hpp:72
The CRTP-policy that computes a single cell in the alignment matrix.
Definition affine_gap_policy.hpp:44
constexpr void compute_first_band_cell(cell_t &¤t_cell, alignment_algorithm_state< score_t > &cache, score_t const score) const noexcept
Computes the score of the first cell within the band.
Definition affine_gap_policy.hpp:141
friend alignment_algorithm_t
Befriends the derived class to grant it access to the private members.
Definition affine_gap_policy.hpp:47
constexpr void compute_cell(cell_t &¤t_cell, alignment_algorithm_state< score_t > &cache, score_t const score) const noexcept
Computes the score of the current cell.
Definition affine_gap_policy.hpp:84
constexpr void initialise_alignment_state(alignment_configuration_t const &config) noexcept
Initialise the alignment state for affine gap computation.
Definition affine_gap_policy.hpp:182
alignment_state_t alignment_state
The internal alignment state tracking the current alignment optimum.
Definition affine_gap_policy.hpp:191
constexpr affine_gap_policy() noexcept=default
Defaulted.
@ up
Trace comes from the above entry.
@ left
Trace comes from the left entry.
@ diagonal
Trace comes from the diagonal entry.
@ carry_up_open
Carry bit for the last up open even if it is not the maximum value.
@ left_open
Trace comes from the left entry, while opening the gap.
@ up_open
Trace comes from the above entry, while opening the gap.
constexpr bool decays_to_ignore_v
Return whether the input type with const, volatile and references removed is std::ignore's type....
Definition basic.hpp:135
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
A strong type of underlying type int32_t that represents the score (usually negative) of any characte...
Definition align_config_gap_cost_affine.hpp:48
A strong type of underlying type int32_t that represents a score (usually negative) that is incurred ...
Definition align_config_gap_cost_affine.hpp:31
score_type gap_extension_score
The cached gap extension score.
Definition alignment_algorithm_state.hpp:34
score_type gap_open_score
The cached gap open score.
Definition alignment_algorithm_state.hpp:36
Provides the declaration of seqan3::detail::trace_directions.
Provides concepts that do not have equivalents in C++20.