mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-21 12:24:25 +08:00
add unit test for plset
(transplanted from 8170ef0b2d3cc146fb2340226fe840e7caa287d0 )
This commit is contained in:
parent
f07fca2c80
commit
7d28c618a0
@ -44,7 +44,7 @@ template<typename Scalar> bool areApproxAbs(const Scalar* a, const Scalar* b, in
|
|||||||
{
|
{
|
||||||
if (!isApproxAbs(a[i],b[i],refvalue))
|
if (!isApproxAbs(a[i],b[i],refvalue))
|
||||||
{
|
{
|
||||||
std::cout << "a[" << i << "]: " << a[i] << " != b[" << i << "]: " << b[i] << std::endl;
|
std::cout << "[" << Map<const Matrix<Scalar,1,Dynamic> >(a,size) << "]" << " != " << Map<const Matrix<Scalar,1,Dynamic> >(b,size) << "\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ template<typename Scalar> bool areApprox(const Scalar* a, const Scalar* b, int s
|
|||||||
{
|
{
|
||||||
if (!internal::isApprox(a[i],b[i]))
|
if (!internal::isApprox(a[i],b[i]))
|
||||||
{
|
{
|
||||||
std::cout << "a[" << i << "]: " << a[i] << " != b[" << i << "]: " << b[i] << std::endl;
|
std::cout << "[" << Map<const Matrix<Scalar,1,Dynamic> >(a,size) << "]" << " != " << Map<const Matrix<Scalar,1,Dynamic> >(b,size) << "\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -275,6 +275,11 @@ template<typename Scalar> void packetmath_real()
|
|||||||
for (int i=0; i<PacketSize; ++i)
|
for (int i=0; i<PacketSize; ++i)
|
||||||
ref[0] = std::max(ref[0],data1[i]);
|
ref[0] = std::max(ref[0],data1[i]);
|
||||||
VERIFY(internal::isApprox(ref[0], internal::predux_max(internal::pload<Packet>(data1))) && "internal::predux_max");
|
VERIFY(internal::isApprox(ref[0], internal::predux_max(internal::pload<Packet>(data1))) && "internal::predux_max");
|
||||||
|
|
||||||
|
for (int i=0; i<PacketSize; ++i)
|
||||||
|
ref[i] = data1[0]+Scalar(i);
|
||||||
|
internal::pstore(data2, internal::plset(data1[0]));
|
||||||
|
VERIFY(areApprox(ref, data2, PacketSize) && "internal::plset");
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Scalar,bool ConjLhs,bool ConjRhs> void test_conj_helper(Scalar* data1, Scalar* data2, Scalar* ref, Scalar* pval)
|
template<typename Scalar,bool ConjLhs,bool ConjRhs> void test_conj_helper(Scalar* data1, Scalar* data2, Scalar* ref, Scalar* pval)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user