SeqAn3  3.0.0
The Modern C++ library for sequence analysis.
rank_to.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2019, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2019, 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 
17 #include <seqan3/std/ranges>
18 
19 namespace seqan3::view
20 {
21 
67 template <typename alphabet_type>
69  requires WritableSemialphabet<alphabet_type>
71 inline auto const rank_to = deep{std::view::transform(
72 [] (alphabet_rank_t<alphabet_type> const in) -> alphabet_type
73 {
74  return assign_rank_to(in, alphabet_type{});
75 })};
76 
78 
79 } // namespace seqan3::view
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition: concept.hpp:207
auto const rank_to
A view over an alphabet, given a range of ranks.
Definition: rank_to.hpp:71
decltype(seqan3::to_rank(std::declval< semi_alphabet_type >())) alphabet_rank_t
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank.
Definition: concept.hpp:112
Provides seqan3::view::deep.
Adaptations of concepts from the Ranges TS.
The SeqAn3 namespace for views.
Core alphabet concept and free function/type trait wrappers.
A wrapper type around an existing view adaptor that enables "deep view" behaviour for that view...
Definition: deep.hpp:101
constexpr auto transform
A range adaptor that takes a invocable and returns a view of the elements with the invocable applied...
Definition: ranges:911