Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
diagonal_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_DIAGONAL_TAGS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_DIAGONAL_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 has an implicit unit diagonal.
20///
21/// An algorithm that is passed a triangular matrix @c A with an implicit unit diagonal will not access the diagonal of
22/// @c A and the algorithm will interpret @c A as if it has a unit diagonal, that is, a diagonal where each of whose
23/// elements behaves as a multiplicative identity.
25 public:
26 /// @brief Explicit default constructor.
27 explicit implicit_unit_diagonal_t() = default;
28};
29
30/// @brief Tag indicating that a triangular matrix stores its diagonal explicitly.
31///
32/// A matrix with an explicit diagonal is a triangular matrix where the diagonal elements are actually stored in the
33/// matrix. The diagonal is the set of all elements of matrix @c A accessed by @c A[i,i] for <c>0 <= i <
34/// min(A.extent(0), A.extent(1))</c>.
36 public:
37 /// @brief Explicit default constructor.
38 explicit explicit_diagonal_t() = default;
39};
40
41// parasoft-begin-suppress CERT_CPP-DCL56-a "False positive: variables are initialized"
42// parasoft-begin-suppress AUTOSAR-M3_4_1-b "This is a per-TU reference to a global used in multiple TUs"
43// parasoft-begin-suppress AUTOSAR-M7_3_3-a "An unnamed namespace is used to create a per-TU reference to a global
44// object used in multiple TUs."
45// parasoft-begin-suppress CERT_CPP-DCL59-a "An unnamed namespace is used to create a per-TU reference to a global
46// object used in multiple TUs."
47
48/// @brief Tag indicating that a triangular matrix has an implicit unit diagonal.
50
51/// @brief Tag indicating that a triangular matrix stores its diagonal explicitly.
53
54// parasoft-end-suppress CERT_CPP-DCL56-a
55// parasoft-end-suppress AUTOSAR-M3_4_1-b
56// parasoft-end-suppress AUTOSAR-M7_3_3-a
57// parasoft-end-suppress CERT_CPP-DCL59-a
58
59/// @brief Determines whether a type, ignoring cv-qualification, is a diagonal storage tag.
60/// @tparam T The type to inspect.
61template <typename T>
62extern constexpr bool is_diagonal_storage_tag_v{
65};
66
67} // namespace linalg
68} // namespace base
69} // namespace arene
70
71#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_DIAGONAL_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 diagonal explicitly.
Definition diagonal_tags.hpp:35
explicit_diagonal_t()=default
Explicit default constructor.
Tag indicating that a triangular matrix has an implicit unit diagonal.
Definition diagonal_tags.hpp:24
implicit_unit_diagonal_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_diagonal_storage_tag_v
Determines whether a type, ignoring cv-qualification, is a diagonal storage tag.
Definition accumulate.hpp:37
Definition accumulate.hpp:36