OpenKalman
slice_specifier.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) 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_SLICE_SPECIFIER_HPP
17 #define OPENKALMAN_SLICE_SPECIFIER_HPP
18 
19 #include "values/values.hpp"
20 
21 namespace OpenKalman::internal
22 {
23  namespace detail
24  {
25  template<typename T>
26  struct is_slice_specifier : std::false_type {};
27 
28  template<typename Begin, typename End>
29  struct is_slice_specifier<std::tuple<Begin, End>> : std::bool_constant<values::index<Begin> and values::index<End>> {};
30 
31  template<>
32  struct is_slice_specifier<stdex::full_extent_t> : std::true_type {};
33 
34  template<typename OffsetType, typename ExtentType, typename StrideType>
35  struct is_slice_specifier<stdex::strided_slice<OffsetType, ExtentType, StrideType>> : std::true_type {};
36  }
37 
38 
42  template<typename T>
43 #ifdef __cpp_concepts
44  concept slice_specifier =
45 #else
46  constexpr inline bool empty_object =
47 #endif
48  values::index<T> or
50 
51 
52 }
53 
54 #endif
Header file for code relating to values (e.g., scalars and indices)
constexpr bool empty_object
Specifies that an object is empty (i.e., at least one index is zero-dimensional). ...
Definition: empty_object.hpp:54
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
Definition: slice_specifier.hpp:26
Definition: basics.hpp:48