mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 01:29:35 +08:00
add cast<>() tests. including a vectorization_logic test that currently fails (casting to same type should not prevent vectorization)
This commit is contained in:
parent
e722f55382
commit
8b1e7c2792
@ -109,6 +109,15 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void casting()
|
||||||
|
{
|
||||||
|
Matrix4f m = Matrix4f::Random(), m2;
|
||||||
|
Matrix4d n = m.cast<double>();
|
||||||
|
VERIFY(m.isApprox(n.cast<float>()));
|
||||||
|
m2 = m.cast<float>(); // check the specialization when NewType == Type
|
||||||
|
VERIFY(m.isApprox(m2));
|
||||||
|
}
|
||||||
|
|
||||||
void test_basicstuff()
|
void test_basicstuff()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < g_repeat; i++) {
|
for(int i = 0; i < g_repeat; i++) {
|
||||||
|
@ -50,6 +50,9 @@ void test_vectorization_logic()
|
|||||||
InnerVectorization,CompleteUnrolling));
|
InnerVectorization,CompleteUnrolling));
|
||||||
VERIFY(test_assign(Vector4f(),Vector4f().cwise() * Vector4f(),
|
VERIFY(test_assign(Vector4f(),Vector4f().cwise() * Vector4f(),
|
||||||
InnerVectorization,CompleteUnrolling));
|
InnerVectorization,CompleteUnrolling));
|
||||||
|
VERIFY(test_assign(Vector4f(),Vector4f().cast<float>(),
|
||||||
|
InnerVectorization,CompleteUnrolling));
|
||||||
|
|
||||||
|
|
||||||
VERIFY(test_assign(Matrix4f(),Matrix4f(),
|
VERIFY(test_assign(Matrix4f(),Matrix4f(),
|
||||||
InnerVectorization,CompleteUnrolling));
|
InnerVectorization,CompleteUnrolling));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user