Template Function Pennylane::Util::isApproxEqual(const std::vector<Data_t, Alloc>&, const std::vector<Data_t, Alloc>&, typename Data_t::value_type)

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 and data2 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.