From b4d2ca7f2da7db0d2a5708a046f7097e200c93d5 Mon Sep 17 00:00:00 2001 From: smehringer Date: Fri, 21 Aug 2020 09:03:44 +0200 Subject: [PATCH] adapt else block in configure_free_ends_initialisation --- .../pairwise/alignment_configurator.hpp | 40 ++++++------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/include/seqan3/alignment/pairwise/alignment_configurator.hpp b/include/seqan3/alignment/pairwise/alignment_configurator.hpp index c4e8aab015..b681291281 100644 --- a/include/seqan3/alignment/pairwise/alignment_configurator.hpp +++ b/include/seqan3/alignment/pairwise/alignment_configurator.hpp @@ -608,12 +608,9 @@ template ; - // Get the value for the sequence ends configuration. - auto align_ends_cfg = cfg.get_or(align_cfg::aligned_ends{free_ends_none}).value; - using align_ends_cfg_t = decltype(align_ends_cfg); // This lambda augments the initialisation policy of the alignment algorithm - // with the aligned_ends configuration from before. + // with the method_global free ends gap configuration from before. auto configure_leading_both = [&] (auto first_seq, auto second_seq) constexpr { // Define the trait for the initialisation policy @@ -634,40 +631,27 @@ constexpr function_wrapper_t alignment_configurator::configure_free_ends_initial } else { + // Get the value for the sequence ends configuration. + auto method_global_cfg = cfg.get_or(align_cfg::method_global{}); + // This lambda determines the initialisation configuration for the second sequence given // the leading gap property for it. auto configure_leading_second = [&] (auto first) constexpr { - // If possible use static information. - if constexpr (align_ends_cfg_t::template is_static<2>()) - { - using second_t = std::integral_constant()>; - return configure_leading_both(first, second_t{}); - } + // Resolve correct property at runtime. + if (method_global_cfg.free_end_gaps_sequence2_leading) + return configure_leading_both(first, std::true_type{}); else - { // Resolve correct property at runtime. - if (align_ends_cfg[2]) - return configure_leading_both(first, std::true_type{}); - else - return configure_leading_both(first, std::false_type{}); - } + return configure_leading_both(first, std::false_type{}); }; // Here the initialisation configuration for the first sequence is determined given // the leading gap property for it. - // If possible use static information. - if constexpr (align_ends_cfg_t::template is_static<0>()) - { - using first_t = std::integral_constant()>; - return configure_leading_second(first_t{}); - } + // Resolve correct property at runtime. + if (method_global_cfg.free_end_gaps_sequence1_leading) + return configure_leading_second(std::true_type{}); else - { // Resolve correct property at runtime. - if (align_ends_cfg[0]) - return configure_leading_second(std::true_type{}); - else - return configure_leading_second(std::false_type{}); - } + return configure_leading_second(std::false_type{}); } } //!\endcond