mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +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:
@@ -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()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
|
||||
Reference in New Issue
Block a user