Loading...
Searching...
No Matches
policy_affine_gap_recursion_banded.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <seqan3/alignment/pairwise/detail/policy_affine_gap_recursion.hpp>
namespace seqan3::detail
{
template <typename alignment_configuration_t>
class policy_affine_gap_recursion_banded : protected policy_affine_gap_recursion<alignment_configuration_t>
{
protected:
using base_t = policy_affine_gap_recursion<alignment_configuration_t>;
// Import base types
using typename base_t::affine_cell_type;
using typename base_t::score_type;
using typename base_t::traits_type;
//Import member types.
using base_t::gap_extension_score;
using base_t::gap_open_score;
policy_affine_gap_recursion_banded() = default;
policy_affine_gap_recursion_banded(policy_affine_gap_recursion_banded const &) = default;
policy_affine_gap_recursion_banded(policy_affine_gap_recursion_banded &&) = default;
policy_affine_gap_recursion_banded &
operator=(policy_affine_gap_recursion_banded const &) = default;
policy_affine_gap_recursion_banded & operator=(policy_affine_gap_recursion_banded &&) = default;
~policy_affine_gap_recursion_banded() = default;
explicit policy_affine_gap_recursion_banded(alignment_configuration_t const & config) : base_t{config}
{}
template <typename affine_cell_t>
affine_cell_type initialise_band_first_cell(score_type diagonal_score,
affine_cell_t previous_cell,
score_type const sequence_score) const noexcept
{
diagonal_score += sequence_score;
score_type horizontal_score = previous_cell.horizontal_score();
diagonal_score = (diagonal_score < horizontal_score) ? horizontal_score : diagonal_score;
score_type from_optimal_score = diagonal_score + gap_open_score;
horizontal_score += gap_extension_score;
horizontal_score = (horizontal_score < from_optimal_score) ? from_optimal_score : horizontal_score;
return {diagonal_score, horizontal_score, from_optimal_score};
}
};
} // namespace seqan3::detail
policy_affine_gap_recursion.hpp
Provides seqan3::detail::policy_affine_gap_recursion.
Hide me