NumCpp  2.18.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Loading...
Searching...
No Matches
array_equiv.hpp
Go to the documentation of this file.
1
28#pragma once
29
33#include "NumCpp/NdArray.hpp"
34
35namespace nc
36{
37 //============================================================================
38 // Method Description:
51 template<typename dtype>
52 bool array_equiv(const NdArray<dtype>& inArray1, const NdArray<dtype>& inArray2) noexcept
53 {
55
56 if (inArray1.size() != inArray2.size())
57 {
58 return false;
59 }
60
62 {
63 return stl_algorithms::equal(inArray1.cbegin(), inArray1.cend(), inArray2.cbegin());
64 }
65
66 const auto comparitor = [](dtype value1, dtype value2) noexcept -> bool
67 { return utils::essentiallyEqual(value1, value2); };
68
69 return stl_algorithms::equal(inArray1.cbegin(), inArray1.cend(), inArray2.cbegin(), comparitor);
70 }
71} // namespace nc
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition StaticAsserts.hpp:56
static constexpr bool isInteger() noexcept
Definition DtypeInfo.hpp:74
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:135
bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2) noexcept
Definition StlAlgorithms.hpp:141
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition essentiallyEqual.hpp:47
Definition Cartesian.hpp:39
bool array_equiv(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2) noexcept
Definition array_equiv.hpp:52