Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
typelist.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//typelist.hpp is free software: you can redistribute it and/or modify
4//it under the terms of the GNU General Public License as published by
5//the Free Software Foundation, either version 3 of the License, or
6//(at your option) any later version.
7//
8//typelist.hpp is distributed in the hope that it will be useful,
9//but WITHOUT ANY WARRANTY; without even the implied warranty of
10//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11//GNU General Public License for more details.
12//
13//You should have received a copy of the GNU General Public License
14//along with typelist.hpp. If not, see <http://www.gnu.org/licenses/>.
15//
16// Copyright(C) Bertini2 Development Team
17//
18// See <http://www.gnu.org/licenses/> for a copy of the license,
19// as well as COPYING. Bertini2 is provided with permitted
20// additional terms in the b2/licenses/ directory.
21
27#pragma once
28
31
32namespace bertini {
33
34namespace detail {
35
41template <typename... Ts>
42struct TypeList {
43 using ToTuple = std::tuple<Ts...>;
44 using ToTupleOfVec = std::tuple<Vec<Ts>...>;
45 using ToTupleOfReal = std::tuple<typename Eigen::NumTraits<Ts>::Real...>;
46
48 template <template<typename> class ContT>
49 using ToTupleOfCont = std::tuple<ContT<Ts>...>;
50
51
53 template<typename ...Rs>
54 static
55 std::tuple<Ts...> Unpermute(const Rs& ...rs)
56 {
57 return bertini::Unpermute<Ts...>(rs...);
58 }
59};
60
61
67template <typename ...Ts>
68struct ListCat {};
69
70
74template <typename ...Ts, typename ... Rs>
75struct ListCat <TypeList<Ts...>, TypeList<Rs...>>
76{
77 using type = TypeList<Ts..., Rs...>;
78};
79
85template <typename ...Ps, typename ... Qs, typename ... Rs>
86struct ListCat <TypeList<Ps...>, TypeList<Qs...>, TypeList<Rs...>>
87{
88 using type = TypeList<Ps..., Qs..., Rs...>;
89};
90
91}} // close namespaces
Bertini extensions of the Eigen linear algebra library.
Contains helper templates, based on and refined from SO post https://stackoverflow....
Definition configured.hpp:34
Definition algorithm_builder.hpp:36
std::tuple< const UnpermutedT &... > Unpermute(const PermutedPresentT &... present_permuted_args)
Reorder a set of present arguments into the declared UnpermutedT order, default-constructing any abse...
Definition enable_permuted_arguments.hpp:117
TypeList< Ps..., Qs..., Rs... > type
The concatenated TypeList.
Definition typelist.hpp:88
TypeList< Ts..., Rs... > type
The concatenated TypeList.
Definition typelist.hpp:77
Concatenate two typelists.
Definition typelist.hpp:68
A basic typelist, in the style of Modern C++ Design, but using variadic templates.
Definition typelist.hpp:42
static std::tuple< Ts... > Unpermute(const Rs &...rs)
Reorder the given arguments into a tuple of the listed types' order.
Definition typelist.hpp:55