5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_EQUAL_ELEMENTS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_EQUAL_ELEMENTS_HPP_
12#include "arene/base/detail/index_permutation_range.hpp"
13#include "arene/base/linalg/detail/mandates.hpp"
14#include "arene/base/mdspan/detail/to_array.hpp"
15#include "arene/base/stdlib_choice/enable_if.hpp"
16#include "arene/base/stdlib_choice/equal_to.hpp"
27namespace equal_elements_detail {
30class equal_elements_fn {
45 typename Comparator = std::equal_to<>,
47 linalg_detail::possibly_comparable_constraints<LhsSpan, RhsSpan>,
50 constexpr auto operator()(LhsSpan
const lhs_span, RhsSpan
const rhs_span, Comparator comp = {})
const noexcept(
58 if (lhs_span.empty()) {
61 auto const extents_array = mdspan_detail::to_array(lhs_span.extents());
63 for (
auto& indices : arene::base::detail::make_index_permutation_range(extents_array)) {
65 if (!comp(lhs_span(indices), rhs_span(indices))) {
#define ARENE_CPP14_INLINE_VARIABLE(type, name)
Emulates C++17's inline variable declarations for function objects.
Definition cpp14_inline.hpp:69
#define ARENE_PRECONDITION(condition)
Check that a precondition holds, and terminate the application if it does not.
Definition contract.hpp:150
Definition accumulate.hpp:37
constexpr bool is_nothrow_invocable_v
Determine if a functor type is no-throw invocable with the specified argument types.
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
Definition accumulate.hpp:36
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41