Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
triangular_tags.hpp
Go to the documentation of this file.
1// Copyright 2026, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_TRIANGULAR_TAGS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_TRIANGULAR_TAGS_HPP_
7
8// IWYU pragma: private, include "arene/base/linalg.hpp"
9// IWYU pragma: friend "(arene/base(?!/tests)|stdlib/include/stdlib_detail)/.*"
10
12#include "arene/base/stdlib_choice/is_same.hpp"
13#include "arene/base/stdlib_choice/remove_cv.hpp"
14
15namespace arene {
16namespace base {
17namespace linalg {
18
19/// @brief Tag indicating that a triangular matrix stores its upper triangle.
20///
21/// The upper triangle of a matrix @c A is the set of all elements of @c A accessed by @c A[i,j] with <c>i <= j</c>. It
22/// includes the diagonal.
24 public:
25 /// @brief Explicit default constructor.
26 explicit upper_triangle_t() = default;
27};
28
29/// @brief Tag indicating that a triangular matrix stores its lower triangle.
30///
31/// The lower triangle of a matrix @c A is the set of all elements of @c A accessed by @c A[i,j] with <c>i >= j</c>. It
32/// includes the diagonal.
34 public:
35 /// @brief Explicit default constructor.
36 explicit lower_triangle_t() = default;
37};
38
39// parasoft-begin-suppress CERT_CPP-DCL56-a "False positive: variables are initialized"
40// parasoft-begin-suppress AUTOSAR-M3_4_1-b "This is a per-TU reference to a global used in multiple TUs"
41// parasoft-begin-suppress AUTOSAR-M7_3_3-a "An unnamed namespace is used to create a per-TU reference to a global
42// object used in multiple TUs."
43// parasoft-begin-suppress CERT_CPP-DCL59-a "An unnamed namespace is used to create a per-TU reference to a global
44// object used in multiple TUs."
45
46/// @brief Tag indicating that a triangular matrix stores its upper triangle.
48
49/// @brief Tag indicating that a triangular matrix stores its lower triangle.
51
52// parasoft-end-suppress CERT_CPP-DCL56-a
53// parasoft-end-suppress AUTOSAR-M3_4_1-b
54// parasoft-end-suppress AUTOSAR-M7_3_3-a
55// parasoft-end-suppress CERT_CPP-DCL59-a
56
57/// @brief Determines whether a type, ignoring cv-qualification, is a triangular matrix storage tag.
58/// @tparam T The type to inspect.
59template <typename T>
60extern constexpr bool is_triangular_tag_v{
63};
64
65} // namespace linalg
66} // namespace base
67} // namespace arene
68
69#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_TRIANGULAR_TAGS_HPP_
#define ARENE_CPP14_INLINE_VARIABLE(type, name)
Emulates C++17's inline variable declarations for function objects.
Definition cpp14_inline.hpp:69
Tag indicating that a triangular matrix stores its lower triangle.
Definition triangular_tags.hpp:33
lower_triangle_t()=default
Explicit default constructor.
Tag indicating that a triangular matrix stores its upper triangle.
Definition triangular_tags.hpp:23
upper_triangle_t()=default
Explicit default constructor.
Trait to detect if the two template parameters are the same or not. The value member is true if the t...
Definition is_same.hpp:35
Definition add.hpp:20
constexpr bool is_triangular_tag_v
Determines whether a type, ignoring cv-qualification, is a triangular matrix storage tag.
Definition accumulate.hpp:37
Definition accumulate.hpp:36