Template Function Pennylane::Util::isApproxEqual(const std::vector<Data_t, Alloc>&, const std::vector<Data_t, Alloc>&, typename Data_t::value_type)¶
Defined in File TestHelpers.hpp
Function Documentation¶
-
template<class Data_t, class Alloc>
inline bool Pennylane::Util::isApproxEqual(const std::vector<Data_t, Alloc> &data1, const std::vector<Data_t, Alloc> &data2, typename Data_t::value_type eps = std::numeric_limits<typename Data_t::value_type>::epsilon() * 100)¶ Utility function to compare
std::vector
of complex statevector data.Note
This utility function is mainly used in Lightning-Kokkos C++ unit tests when the
data1
anddata2
allocators are identical.- Template Parameters
Data_t – Floating point data-type.
- Parameters
data1 – StateVector data array pointer 1.
data2 – StateVector data array pointer 2.
eps – The absolute tolerance parameter.
- Returns
true Data are approximately equal.
- Returns
false Data are not approximately equal.
api/function_TestHelpers_8hpp_1a8b9a315d5d5bb360b6acb6e97864f6cb
Download Python script
Download Notebook
View on GitHub