OpenKalman
make_zero.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 
16 #ifndef OPENKALMAN_MAKE_ZERO_HPP
17 #define OPENKALMAN_MAKE_ZERO_HPP
18 
19 #include "make_constant.hpp"
20 
21 namespace OpenKalman
22 {
28 #ifdef __cpp_concepts
29  template<values::value C = double, values::integral IndexType, std::size_t...Extents>
30  constexpr constant_object auto
31 #else
32  template<typename C = double, typename IndexType, std::size_t...Extents, std::enable_if_t<values::value<C>, int> = 0>
33  constexpr auto
34 #endif
36  {
37  return make_constant(values::fixed_value<C, 0>{}, std::move(extents));
38  }
39 
40 
48 /*#ifdef __cpp_concepts
49  template<indexible T, values::number Scalar = scalar_type_of_t<T>, pattern_collection Descriptors>
50  constexpr zero auto
51 #else
52  template<typename T, typename Scalar = scalar_type_of_t<T>, typename...Ds, std::enable_if_t<indexible<T> and
53  values::number<Scalar> and pattern_collection<Descriptors>, int> = 0>
54  constexpr auto
55 #endif
56  make_zero(Descriptors&& descriptors)
57  {
58  return make_constant<T, Scalar, 0>(std::forward<Descriptors>(descriptors));
59  }*/
60 
61 
66 /*#ifdef __cpp_concepts
67  template<indexible T, values::number Scalar = scalar_type_of_t<T>, coordinates::pattern...Ds>
68  constexpr zero auto
69 #else
70  template<typename T, typename Scalar = scalar_type_of_t<T>, typename...Ds, std::enable_if_t<indexible<T> and
71  values::number<Scalar> and (... and coordinates::pattern<Ds>), int> = 0>
72  constexpr auto
73 #endif
74  make_zero(Ds&&...ds)
75  {
76  return make_zero<T, Scalar>(std::tuple {std::forward<Ds>(ds)...});
77  }*/
78 
79 
86 /*#ifdef __cpp_concepts
87  template<values::number Scalar, indexible T>
88  constexpr zero auto
89 #else
90  template<typename Scalar, typename T, std::enable_if_t<values::number<Scalar> and indexible<T>, int> = 0>
91  constexpr auto
92 #endif
93  make_zero(const T& t)
94  {
95  return make_constant<Scalar, 0>(t);
96  }*/
97 
98 
99 
105 /*#ifdef __cpp_concepts
106  template<indexible T>
107  constexpr zero auto
108 #else
109  template<typename T, std::enable_if_t<indexible<T>, int> = 0>
110  constexpr auto
111 #endif
112  make_zero(const T& t)
113  {
114  return make_constant<scalar_type_of_t<T>, 0>(t);
115  }*/
116 
117 
118 }
119 
120 #endif
Definition: fixed_value.hpp:41
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
The root namespace for OpenKalman.
Definition: basics.hpp:34
constexpr auto make_zero(stdex::extents< IndexType, Extents... > extents)
Make an indexible object in which every element is 0.
Definition: make_zero.hpp:35
constexpr bool integral
T is an integral value.
Definition: integral.hpp:47
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
constexpr auto make_constant(C c, stdex::extents< IndexType, Extents... > extents)
Make an indexible object in which every element is a constant value.
Definition: make_constant.hpp:39
Definitions for make_constant.
Definition: extents.hpp:372