Verified Commit 24651874 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

math/tensor: add operator{==,!=} for Eigen::array

parent 9f365394
......@@ -39,6 +39,23 @@
T values[n];
};
template<class T, std::size_t n>
EIGEN_DEVICE_FUNC bool operator==(const array<T,n> & lhs, const array<T,n> & rhs)
{
for (std::size_t i = 0; i < n; ++i) {
if (lhs[i] != rhs[i]) {
return false;
}
}
return true;
}
template<class T, std::size_t n>
EIGEN_DEVICE_FUNC bool operator!=(const array<T,n> & lhs, const array<T,n> & rhs)
{
return !(lhs == rhs);
}
} // namespace Eigen
#else
#include <array>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment