SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
type_traits.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
25 #include <seqan3/std/ranges>
26 
27 namespace seqan3::detail
28 {
29 
42 template <typename sequence_pairs_t>
44  requires sequence_pair_range<std::remove_reference_t<sequence_pairs_t>>
46 struct chunked_indexed_sequence_pairs
47 {
49  using type = decltype(views::zip(std::declval<sequence_pairs_t>(), std::views::iota(0)) | views::chunk(1));
50 };
51 
58 template <typename config_t>
60  requires is_type_specialisation_of_v<config_t, configuration>
62 struct alignment_configuration_traits
63 {
65  static constexpr bool is_vectorised = config_t::template exists<remove_cvref_t<decltype(align_cfg::vectorise)>>();
67  static constexpr bool is_parallel = config_t::template exists<align_cfg::parallel>();
69  static constexpr bool is_global = config_t::template exists<align_cfg::mode<detail::global_alignment_type>>();
71  static constexpr bool is_aligned_ends = config_t::template exists<align_cfg::aligned_ends>();
73  static constexpr bool is_local = config_t::template exists<align_cfg::mode<detail::local_alignment_type>>();
75  static constexpr bool is_banded = config_t::template exists<align_cfg::band>();
77  static constexpr bool is_debug = config_t::template exists<detail::debug_mode>();
78 
80  using alignment_mode_t = decltype(get<align_cfg::mode>(std::declval<config_t>()).value);
82  using scoring_scheme_t = decltype(get<align_cfg::scoring>(std::declval<config_t>()).value);
84  using scoring_scheme_alphabet_t = typename scoring_scheme_t::alphabet_type;
86  using result_t = std::remove_reference_t<decltype(seqan3::get<align_cfg::result>(std::declval<config_t>()))>;
88  using original_score_t = typename result_t::score_type;
90  using score_t = std::conditional_t<is_vectorised, simd_type_t<original_score_t>, original_score_t>;
92  using trace_t = std::conditional_t<is_vectorised, simd_type_t<original_score_t>, trace_directions>;
93 
95  static constexpr size_t alignments_per_vector = [] () constexpr
96  {
97  if constexpr (is_vectorised)
98  return simd_traits<score_t>::length;
99  else
100  return 1;
101  }();
103  static constexpr int8_t result_type_rank = static_cast<int8_t>(decltype(std::declval<result_t>().value)::rank);
105  static constexpr original_score_t padding_symbol =
106  static_cast<original_score_t>(1u << (sizeof_bits<original_score_t> - 1));
107 };
108 
109 } // namespace seqan3::detail
seqan3::remove_cvref_t
std::remove_cv_t< std::remove_reference_t< t > > remove_cvref_t
Return the input type with const, volatile and references removed (type trait).
Definition: basic.hpp:35
zip.hpp
Provides seqan3::views::zip.
bit_manipulation.hpp
Provides utility functions for bit twiddling.
configuration.hpp
Provides seqan3::detail::configuration and utility functions.
template_inspection.hpp
Provides seqan3::type_list and auxiliary type traits.
chunk.hpp
Provides seqan3::views::chunk.
trace_directions.hpp
Provides the declaration of seqan3::detail::trace_directions.
simd.hpp
Provides seqan3::simd::simd_type.
simd_traits.hpp
Provides seqan3::simd::simd_traits.
concept.hpp
Provides concepts needed internally for the alignment algorithms.
all.hpp
Meta-header for the alignment configuration module .
ranges
Adaptations of concepts from the Ranges TS.
std::remove_reference_t
std::conditional_t
std::experimental::filesystem::exists
T exists(T... args)