NumCpp  2.18.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Loading...
Searching...
No Matches
logical_xor.hpp
Go to the documentation of this file.
1
28#pragma once
29
31#include "NumCpp/NdArray.hpp"
32
33namespace nc
34{
35 //============================================================================
36 // Method Description:
46 template<typename dtype>
47 NdArray<bool> logical_xor(const NdArray<dtype>& inArray1, const NdArray<dtype>& inArray2)
48 {
50
51 return broadcast::broadcaster<bool>(inArray1,
52 inArray2,
53 [](dtype inValue1, dtype inValue2) -> bool
54 {
55 return !utils::essentiallyEqual(inValue1, dtype{ 0 }) !=
56 !utils::essentiallyEqual(inValue2, dtype{ 0 });
57 });
58 }
59} // namespace nc
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition StaticAsserts.hpp:56
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:135
NdArray< dtypeIn1 > & broadcaster(NdArray< dtypeIn1 > &inArray1, const NdArray< dtypeIn2 > &inArray2, const Function &function, const AdditionalFunctionArgs &&... additionalFunctionArgs)
Definition NdArrayBroadcast.hpp:51
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition essentiallyEqual.hpp:47
Definition Cartesian.hpp:39
NdArray< bool > logical_xor(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition logical_xor.hpp:47