Loading...
Searching...
No Matches
edit_distance_fwd.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 <concepts>
#include <ranges>
#include <seqan3/alignment/configuration/align_config_min_score.hpp>
#include <seqan3/alignment/pairwise/align_result_selector.hpp>
#include <seqan3/alignment/pairwise/detail/type_traits.hpp>
#include <seqan3/core/detail/deferred_crtp_base.hpp>
#include <seqan3/core/platform.hpp>
#include <seqan3/utility/detail/bits_of.hpp>
namespace seqan3::detail
{
template <typename word_t, typename score_t, bool is_semi_global, bool use_max_errors>
class edit_distance_score_matrix_full; //forward declaration
template <typename word_t, bool is_semi_global, bool use_max_errors>
class edit_distance_trace_matrix_full; //forward declaration
template <typename state_t, typename...>
struct empty_state
{};
template <bool enabled, typename state_t>
using enable_state_t = std::conditional_t<enabled, state_t, empty_state<state_t>>;
template <bool B, template <typename...> typename T, template <typename...> typename F>
struct selector
{
template <typename... args_t>
struct select : public std::conditional_t<B, T<args_t...>, F<args_t...>>
{};
};
template <std::ranges::viewable_range database_t,
std::ranges::viewable_range query_t,
typename align_config_t,
typename is_semi_global_t,
typename word_t = uint_fast64_t>
struct default_edit_distance_trait_type
{
using align_config_type = std::remove_reference_t<align_config_t>;
using alignment_traits_type = alignment_configuration_traits<align_config_type>;
using word_type = word_t;
static_assert(std::is_unsigned_v<word_type>, "the word type of edit_distance_unbanded must be unsigned.");
static_assert(alignment_traits_type::has_output_configuration, "We assume the result type was configured.");
using score_type = typename alignment_traits_type::original_score_type;
using database_type = std::remove_reference_t<database_t>;
using query_type = std::remove_reference_t<query_t>;
static constexpr uint8_t word_size = bits_of<word_type>;
static_assert(bits_of<word_type> <= 64u, "we assume at most uint64_t as word_type");
using database_iterator = std::ranges::iterator_t<database_type>;
using query_alphabet_type = std::remove_reference_t<std::ranges::range_reference_t<query_type>>;
using alignment_result_type = typename alignment_traits_type::alignment_result_type;
using result_value_type = typename alignment_result_value_type_accessor<alignment_result_type>::type;
static constexpr bool use_max_errors = align_config_type::template exists<align_cfg::min_score>();
static constexpr bool is_semi_global = is_semi_global_t::value;
static constexpr bool is_global = !is_semi_global;
static constexpr bool compute_score = true;
static constexpr bool compute_sequence_alignment = alignment_traits_type::compute_sequence_alignment;
static constexpr bool compute_begin_positions =
alignment_traits_type::compute_begin_positions || compute_sequence_alignment;
static constexpr bool compute_end_positions =
alignment_traits_type::compute_end_positions || compute_begin_positions;
static constexpr bool compute_score_matrix = false;
static constexpr bool compute_trace_matrix = compute_begin_positions || compute_sequence_alignment;
static constexpr bool compute_matrix = compute_score_matrix || compute_trace_matrix;
using trace_matrix_type = edit_distance_trace_matrix_full<word_type, is_semi_global, use_max_errors>;
using score_matrix_type = edit_distance_score_matrix_full<word_type, score_type, is_semi_global, use_max_errors>;
};
template <bool enable_policy, template <typename...> typename policy_t, typename edit_traits, typename derived_t>
using edit_distance_base = invoke_deferred_crtp_base<
deferred_crtp_base<selector<enable_policy, policy_t, empty_state>::template select, edit_traits>,
derived_t>;
template <std::ranges::viewable_range database_t,
std::ranges::viewable_range query_t,
typename align_config_t,
typename traits_t>
class edit_distance_unbanded; //forward declaration
} // namespace seqan3::detail
align_config_min_score.hpp
Provides seqan3::align_cfg::min_score configuration.
align_result_selector.hpp
Provides seqan3::detail::align_result_selector.
type_traits.hpp
Provides helper type traits for the configuration and execution of the alignment algorithm.
bits_of.hpp
Provides utility functions for bit twiddling.
deferred_crtp_base.hpp
Provides seqan3::detail::deferred_crtp_base.
std::is_unsigned_v
T is_unsigned_v
platform.hpp
Provides platform and dependency checks.
Hide me