OpenKalman
enumerations.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_ENUMERATIONS_HPP
17 #define OPENKALMAN_ENUMERATIONS_HPP
18 
19 namespace OpenKalman
20 {
26  enum struct triangle_type : int {
27  none,
28  any,
29  lower,
30  upper,
31  diagonal,
32  // \todo strict_diagonal,
33  //< A specific diagonal object for rank 2k (k:ℕ) tensors in which each element is zero unless its
34  //< indices can be divided into two identical sequences.
35  //< (Examples, component x[1,0,2,1,0,2] in rank-6 tensor x or component y[2,5,2,5] in rank-4 tensor y.)
36  };
37 
38 
42  constexpr triangle_type
43  operator * (triangle_type a, triangle_type b)
44  {
45  if (a == triangle_type::diagonal or
49  if (a == triangle_type::lower or
51  if (a == triangle_type::upper or
53  if (a == triangle_type::any or
55  return triangle_type::none;
56  }
57 
58 
62  constexpr triangle_type
63  operator + (triangle_type a, triangle_type b)
64  {
65  if (a == triangle_type::diagonal) return b;
66  if (b == triangle_type::diagonal) return a;
69  return triangle_type::none;
70  }
71 
72 
79  enum struct HermitianAdapterType : int {
80  none = static_cast<int>(triangle_type::none),
81  any = static_cast<int>(triangle_type::diagonal),
82  lower = static_cast<int>(triangle_type::lower),
83  upper = static_cast<int>(triangle_type::upper),
84  };
85 
86 }
87 
88 
89 #endif
triangle_type
The type of a triangular matrix.
Definition: enumerations.hpp:26
A lower-left triangular matrix.
HermitianAdapterType
The type of a hermitian adapter, indicating which triangle of the nested matrix is used...
Definition: enumerations.hpp:79
A diagonal matrix (both a lower-left and an upper-right triangular matrix).
Lower, upper, or diagonal matrix.
The root namespace for OpenKalman.
Definition: basics.hpp:34
An upper-right triangular matrix.