25namespace seqan3::detail
34SEQAN3_CONCEPT arithmetic_or_simd =
arithmetic<t> || simd_concept<t>;
44SEQAN3_CONCEPT tracedirections_or_simd = std::same_as<std::remove_cvref_t<t>, trace_directions> || simd_concept<t>;
60 std::tuple_size_v<t> == 3 &&
61 arithmetic_or_simd<std::remove_reference_t<std::tuple_element_t<0, t>>> &&
62 arithmetic_or_simd<std::remove_reference_t<std::tuple_element_t<1, t>>> &&
63 arithmetic_or_simd<std::remove_reference_t<std::tuple_element_t<2, t>>>;
79 std::tuple_size_v<t> == 3 &&
80 tracedirections_or_simd<std::remove_reference_t<std::tuple_element_t<0, t>>> &&
81 tracedirections_or_simd<std::remove_reference_t<std::tuple_element_t<1, t>>> &&
82 tracedirections_or_simd<std::remove_reference_t<std::tuple_element_t<2, t>>>;
98 std::tuple_size_v<t> == 2 &&
99 affine_score_cell<std::tuple_element_t<0, t>> &&
100 affine_trace_cell<std::tuple_element_t<1, t>>;
117template <
typename tuple_t>
119 requires (affine_score_cell<tuple_t> || affine_score_and_trace_cell<tuple_t>)
121class affine_cell_proxy :
public tuple_t
128 std::tuple_element_t<1, tuple_t>,
135 affine_cell_proxy() =
default;
136 affine_cell_proxy(affine_cell_proxy
const &) =
default;
137 affine_cell_proxy(affine_cell_proxy &&) =
default;
138 affine_cell_proxy & operator=(affine_cell_proxy
const &) =
default;
139 affine_cell_proxy & operator=(affine_cell_proxy &&) =
default;
140 ~affine_cell_proxy() =
default;
143 using tuple_t::tuple_t;
146 template <
typename other_tuple_t>
148 requires std::constructible_from<tuple_t, other_tuple_t &&>
150 explicit affine_cell_proxy(other_tuple_t && other) :
155 template <
typename other_tuple_t>
157 requires std::constructible_from<tuple_t, other_tuple_t const &>
159 explicit affine_cell_proxy(affine_cell_proxy<other_tuple_t>
const & other) :
160 tuple_t{static_cast<other_tuple_t const &>(other)}
164 template <
typename other_tuple_t>
166 requires std::constructible_from<tuple_t, other_tuple_t>
168 explicit affine_cell_proxy(affine_cell_proxy<other_tuple_t> && other) :
169 tuple_t{static_cast<other_tuple_t &&>(
std::move(other))}
173 template <
typename other_tuple_t>
175 requires std::assignable_from<tuple_t &, other_tuple_t &&>
177 affine_cell_proxy & operator=(other_tuple_t && other)
179 as_base() = std::forward<other_tuple_t>(other);
184 template <
typename other_tuple_t>
186 requires std::assignable_from<tuple_t &, other_tuple_t const &>
188 affine_cell_proxy & operator=(affine_cell_proxy<other_tuple_t>
const & other)
190 as_base() =
static_cast<other_tuple_t
const &
>(other);
195 template <
typename other_tuple_t>
197 requires std::assignable_from<tuple_t &, other_tuple_t>
199 affine_cell_proxy & operator=(affine_cell_proxy<other_tuple_t> && other)
201 as_base() =
static_cast<other_tuple_t &&
>(std::move(other));
211 decltype(
auto) best_score() &
noexcept {
return get_score_impl<0>(*
this); }
213 decltype(
auto) best_score()
const &
noexcept {
return get_score_impl<0>(*
this); }
215 decltype(
auto) best_score() &&
noexcept {
return get_score_impl<0>(std::move(*
this)); }
217 decltype(
auto) best_score()
const &&
noexcept
219#if SEQAN3_WORKAROUND_GCC_94967
221 using return_t = std::tuple_element_t<0, score_cell_type>;
222 return static_cast<return_t
const &&
>(get_score_impl<0>(std::move(*
this)));
224 return get_score_impl<0>(std::move(*
this));
229 decltype(
auto) horizontal_score() &
noexcept {
return get_score_impl<1>(*
this); }
231 decltype(
auto) horizontal_score()
const &
noexcept {
return get_score_impl<1>(*
this); }
233 decltype(
auto) horizontal_score() &&
noexcept {
return get_score_impl<1>(std::move(*
this)); }
235 decltype(
auto) horizontal_score()
const &&
noexcept
237#if SEQAN3_WORKAROUND_GCC_94967
239 using return_t = std::tuple_element_t<1, score_cell_type>;
240 return static_cast<return_t
const &&
>(get_score_impl<1>(std::move(*
this)));
242 return get_score_impl<1>(std::move(*
this));
247 decltype(
auto) vertical_score() &
noexcept {
return get_score_impl<2>(*
this); }
249 decltype(
auto) vertical_score()
const &
noexcept {
return get_score_impl<2>(*
this); }
251 decltype(
auto) vertical_score() &&
noexcept {
return get_score_impl<2>(std::move(*
this)); }
253 decltype(
auto) vertical_score()
const &&
noexcept
255#if SEQAN3_WORKAROUND_GCC_94967
257 using return_t = std::tuple_element_t<2, score_cell_type>;
258 return static_cast<return_t
const &&
>(get_score_impl<2>(std::move(*
this)));
260 return get_score_impl<2>(std::move(*
this));
270 decltype(
auto) best_trace() &
noexcept
272 requires affine_score_and_trace_cell<tuple_t>
275 return get_trace_impl<0>(*
this);
278 decltype(
auto) best_trace()
const &
noexcept
280 requires affine_score_and_trace_cell<tuple_t>
283 return get_trace_impl<0>(*
this);
286 decltype(
auto) best_trace() &&
noexcept
288 requires affine_score_and_trace_cell<tuple_t>
291 return get_trace_impl<0>(std::move(*
this));
294 decltype(
auto) best_trace()
const &&
noexcept
296 requires affine_score_and_trace_cell<tuple_t>
299#if SEQAN3_WORKAROUND_GCC_94967
301 using return_t = std::tuple_element_t<0, trace_cell_type>;
302 return static_cast<return_t
const &&
>(get_trace_impl<0>(std::move(*
this)));
304 return get_trace_impl<0>(std::move(*
this));
309 decltype(
auto) horizontal_trace() &
noexcept
311 requires affine_score_and_trace_cell<tuple_t>
314 return get_trace_impl<1>(*
this);
317 decltype(
auto) horizontal_trace()
const &
noexcept
319 requires affine_score_and_trace_cell<tuple_t>
322 return get_trace_impl<1>(*
this);
325 decltype(
auto) horizontal_trace() &&
noexcept
327 requires affine_score_and_trace_cell<tuple_t>
330 return get_trace_impl<1>(std::move(*
this));
333 decltype(
auto) horizontal_trace()
const &&
noexcept
335 requires affine_score_and_trace_cell<tuple_t>
338#if SEQAN3_WORKAROUND_GCC_94967
340 using return_t = std::tuple_element_t<1, trace_cell_type>;
341 return static_cast<return_t
const &&
>(get_trace_impl<1>(std::move(*
this)));
343 return get_trace_impl<1>(std::move(*
this));
348 decltype(
auto) vertical_trace() &
noexcept
350 requires affine_score_and_trace_cell<tuple_t>
353 return get_trace_impl<2>(*
this);
356 decltype(
auto) vertical_trace()
const &
noexcept
358 requires affine_score_and_trace_cell<tuple_t>
361 return get_trace_impl<2>(*
this);
364 decltype(
auto) vertical_trace() &&
noexcept
366 requires affine_score_and_trace_cell<tuple_t>
369 return get_trace_impl<2>(std::move(*
this));
372 decltype(
auto) vertical_trace()
const &&
noexcept
374 requires affine_score_and_trace_cell<tuple_t>
377#if SEQAN3_WORKAROUND_GCC_94967
379 using return_t = std::tuple_element_t<2, trace_cell_type>;
380 return static_cast<return_t
const &&
>(get_trace_impl<2>(std::move(*
this)));
382 return get_trace_impl<2>(std::move(*
this));
396 template <
size_t index,
typename this_t>
400 static constexpr decltype(
auto) get_score_impl(this_t && me)
noexcept
404 if constexpr (affine_score_cell<tuple_t>)
405 return get<index>(std::forward<this_t>(me));
407 return get<index>(get<0>(std::forward<this_t>(me)));
418 template <
size_t index,
typename this_t>
420 requires (index < 3 && affine_score_and_trace_cell<tuple_t>)
422 static constexpr decltype(
auto) get_trace_impl(this_t && me)
noexcept
426 return get<index>(get<1>(std::forward<this_t>(me)));
430 tuple_t & as_base() &
noexcept
432 return static_cast<tuple_t &
>(*this);
440template <
typename tuple_t>
442 requires (seqan3::detail::affine_score_cell<tuple_t> || seqan3::detail::affine_score_and_trace_cell<tuple_t>)
444struct tuple_size<seqan3::detail::affine_cell_proxy<tuple_t>> :
public tuple_size<tuple_t>
447template <
size_t index,
typename tuple_t>
449 requires (seqan3::detail::affine_score_cell<tuple_t> || seqan3::detail::affine_score_and_trace_cell<tuple_t>)
451struct tuple_element<index, seqan3::detail::affine_cell_proxy<tuple_t>> :
public tuple_element<index, tuple_t>
The <concepts> header from C++20's standard library.
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
Provides seqan3::detail::empty_type.
A type that satisfies std::is_arithmetic_v<t>.
Whether a type behaves like a tuple.
constexpr auto const & get(configuration< configs_t... > const &config) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: configuration.hpp:429
SeqAn specific customisations in the standard namespace.
Provides the declaration of seqan3::detail::trace_directions.
Provides seqan3::simd::simd_concept.
Provides seqan3::tuple_like.