OpenKalman
constant_object.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) 2019-2025 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_CONSTANT_OBJECT_HPP
17 #define OPENKALMAN_CONSTANT_OBJECT_HPP
18 
19 #include "values/values.hpp"
25 
26 namespace OpenKalman
27 {
28 #ifndef __cpp_concepts
29  namespace detail
30  {
31  template<typename T, typename = void>
32  struct element_type_is_fixed : std::false_type {};
33 
34  template<typename T>
35  struct element_type_is_fixed<T, std::enable_if_t<values::fixed<typename element_type_of<T>::type>>>
36  : std::true_type {};
37  }
38 #endif
39 
40 
45  template<typename T>
46 #ifdef __cpp_concepts
47  concept constant_object =
48  indexible<T> and
49  ((interface::get_constant_defined_for<T> and not triangular_matrix<T>) or
51  zero<T> or
52  one_dimensional<T>);
53 #else
54  constexpr bool constant_object =
55  indexible<T> and
56  ((interface::get_constant_defined_for<T> and not triangular_matrix<T>) or
58  zero<T> or
59  one_dimensional<T>);
60 #endif
61 
62 }
63 
64 #endif
Definition for triangular_matrix.
Header file for code relating to values (e.g., scalars and indices)
The root namespace for OpenKalman.
Definition: basics.hpp:34
constexpr bool constant_object
Specifies that all elements of an object are known at compile time to be the same constant value...
Definition: constant_object.hpp:54
Definition for indexible.
constexpr bool fixed
T is a value that is determinable at compile time.
Definition: fixed.hpp:66
Concepts for testing whether object_traits or library_interface definitions exist for a particular ob...
Definition for one_dimensional.
Definition: constant_object.hpp:32
Definition for zero.
typename element_type_of< T >::type element_type_of_t
helper template for element_type_of.
Definition: element_type_of.hpp:54