OpenKalman
has_uniform_static_vector_space_descriptors.hpp
Go to the documentation of this file.
1 /* This file is part of OpenKalman, a header-only C++ library for
2  * Kalman filters and other recursive filters.
3  *
4  * Copyright (c) 2022-2024 Christopher Lee Ogden <ogden@gatech.edu>
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
9  */
10 
17 #ifndef OPENKALMAN_HAS_UNIFORM_FIXED_VECTOR_SPACE_DESCRIPTORS_HPP
18 #define OPENKALMAN_HAS_UNIFORM_FIXED_VECTOR_SPACE_DESCRIPTORS_HPP
19 
20 namespace OpenKalman::internal
21 {
22  namespace detail
23  {
24  template<typename Arg, std::size_t...Is>
25  constexpr bool indices_are_uniform_impl(std::index_sequence<Is...>)
26  {
27  return (... and uniform_static_vector_space_descriptor<vector_space_descriptor_of_t<Arg, Is>>);
28  }
29  } // namespace detail
30 
31 
37  template<typename Arg, std::size_t...indices>
38 #ifdef __cpp_concepts
39  concept has_uniform_static_vector_space_descriptors =
40 #else
41  constexpr bool has_uniform_static_vector_space_descriptors =
42 #endif
43  indexible<Arg> and
44  (sizeof...(indices) == 0 or detail::indices_are_uniform_impl<Arg>(std::index_sequence<indices...>{})) and
45  (sizeof...(indices) > 0 or detail::indices_are_uniform_impl<Arg>(std::make_index_sequence<index_count_v<Arg>>{}));
46 
47 
48 } // namespace OpenKalman::internal
49 
50 #endif //OPENKALMAN_HAS_UNIFORM_FIXED_VECTOR_SPACE_DESCRIPTORS_HPP
Definition: basics.hpp:48