OpenKalman
is_one_dimensional.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-2026 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 
16 #ifndef OPENKALMAN_IS_ONE_DIMENSIONAL_HPP
17 #define OPENKALMAN_IS_ONE_DIMENSIONAL_HPP
18 
19 #include "patterns/patterns.hpp"
22 
23 namespace OpenKalman
24 {
30 #ifdef __cpp_concepts
31  template<auto N = values::unbounded_size, indexible T> requires
32  (values::integral<decltype(N)> or stdex::same_as<std::decay_t<decltype(N)>, values::unbounded_size_t>) and
33  (not values::integral<decltype(N)> or N >= 0)
34  constexpr internal::boolean_testable auto
35 #else
36  template<std::size_t N = values::unbounded_size, typename T, std::enable_if_t<
37  (N == values::unbounded_size or N >= 0) and indexible<T>, int> = 0>
38  constexpr auto
39 #endif
40  is_one_dimensional(const T& t)
41  {
42  return patterns::compare_collection_patterns_with_dimension<1_uz, &stdex::is_eq, N>(get_pattern_collection(t));
43  }
44 
45 }
46 
47 #endif
decltype(auto) constexpr get_pattern_collection(T &&t)
Get the patterns::pattern_collection associated with indexible object T.
Definition: get_pattern_collection.hpp:36
constexpr auto is_one_dimensional(const T &t)
Determine whether T is one_dimensional, meaning that every index has a dimension of 1...
Definition: is_one_dimensional.hpp:40
The root namespace for OpenKalman.
Definition: basics.hpp:34
constexpr bool integral
T is an integral value.
Definition: integral.hpp:47
Definition of get_pattern_collection function.
Definition for indexible.
constexpr unbounded_size_t unbounded_size
An instance of unbounded_size_t;.
Definition: size.hpp:60