BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
rank_to.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2022 deCODE Genetics
3// Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
4// Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
5// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
6// shipped with this file and also available at: https://github.com/biocpp/biocpp-core/blob/main/LICENSE.md
7// -----------------------------------------------------------------------------------------------------
8
14#pragma once
15
16#include <ranges>
17
20
21namespace bio::ranges::views
22{
23
68template <typename alphabet_type>
69 requires alphabet::writable_semialphabet<alphabet_type>
70inline auto const rank_to = deep{std::views::transform([](alphabet::rank_t<alphabet_type> const in) -> alphabet_type
71 { return alphabet::assign_rank_to(in, alphabet_type{}); })};
72
74
75} // namespace bio::ranges::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:104
Provides bio::views::deep.
decltype(bio::alphabet::to_rank(std::declval< semi_alphabet_type >())) rank_t
The rank_type of the semi-alphabet; defined as the return type of bio::alphabet::to_rank.
Definition: concept.hpp:90
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition: concept.hpp:138
auto const rank_to
A view over an alphabet, given a range of ranks.
Definition: rank_to.hpp:70
The BioC++ namespace for views.