Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
subtract.hpp
Go to the documentation of this file.
1
// parasoft-suppress AUTOSAR-A2_8_1-a "False positive: also defines arene::base::linalg::subtract"
2
// Copyright 2026, Toyota Motor Corporation
3
//
4
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5
#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_SUBTRACT_HPP_
6
#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_SUBTRACT_HPP_
7
8
// IWYU pragma: private, include "arene/base/linalg.hpp"
9
// IWYU pragma: friend "(arene/base(?!/tests)|stdlib/include/stdlib_detail)/.*"
10
11
// parasoft-begin-suppress AUTOSAR-A16_2_2-a "Arene Base aggregate headers permitted by A16-2-2 Permit #1"
12
#include "
arene/base/compiler_support/cpp14_inline.hpp
"
13
#include "
arene/base/functional/bind_back.hpp
"
// IWYU pragma: export
14
#include "
arene/base/linalg/elementwise_binary_transform.hpp
"
// IWYU pragma: export
15
#include "arene/base/stdlib_choice/minus.hpp"
// IWYU pragma: export
16
// parasoft-end-suppress AUTOSAR-A16_2_2-a
17
18
namespace
arene
{
19
namespace
base
{
20
namespace
linalg
{
21
22
/// @brief subract two mdspans elementwise, writing the result into a third
23
/// @tparam LhsInSpan The type of the first input span
24
/// @tparam RhsInSpan The type of the second input span
25
/// @tparam OutSpan The type of the output span
26
/// Pass the first and second input spans as @c lhs_span and @c rhs_span, and the output span as @c out_span.
27
///
28
/// @pre All of @c LhsInSpan , @c RhsInSpan , and @c OutSpan must be instantiations of @c mdspan with the same @c rank
29
/// @pre if @c lhs_in_span and @c out_span overlap, they must alias
30
/// @pre if @c rhs_in_span and @c out_span overlap, they must alias
31
/// @pre @c std::minus must be invocable with elements of the input spans, and the result must be assignable to the
32
/// elements of the output span
33
/// @pre All of @c lhs_span , @c rhs_span , and @c out_span must have equal extents
34
// parasoft-begin-suppress CERT_CPP-DCL56-a "False positive: variable is initialized"
35
// parasoft-begin-suppress AUTOSAR-M3_4_1-b "This is a per-TU reference to a global used in multiple TUs"
36
ARENE_CPP14_INLINE_VARIABLE_INIT
(subtract, arene::base::bind_back(elementwise_binary_transform,
std::minus<>
{}));
37
// parasoft-begin-suppress AUTOSAR-M3_4_1-b
38
// parasoft-end-suppress CERT_CPP-DCL56-a
39
40
}
// namespace linalg
41
}
// namespace base
42
}
// namespace arene
43
44
#endif
// INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_SUBTRACT_HPP_
bind_back.hpp
std::minus
Function object for performing subtraction.
Definition
minus.hpp:27
cpp14_inline.hpp
ARENE_CPP14_INLINE_VARIABLE_INIT
#define ARENE_CPP14_INLINE_VARIABLE_INIT(name,...)
Emulates C++17's inline variable declarations for an arbitrary initializer expression.
Definition
cpp14_inline.hpp:95
elementwise_binary_transform.hpp
arene::base::linalg
Definition
add.hpp:20
arene::base
Definition
accumulate.hpp:37
arene
Definition
accumulate.hpp:36
arene
base
linalg
subtract.hpp
Generated by
1.13.2