mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-16 14:49:39 +08:00
Added unit test for matrix creation from const raw data.
This commit is contained in:
parent
6f5c45ceff
commit
dbfb53e8ef
@ -195,6 +195,20 @@ void casting()
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename Scalar>
|
||||
void fixedSizeMatrixConstruction()
|
||||
{
|
||||
const Scalar raw[3] = {1,2,3};
|
||||
Matrix<Scalar,3,1> m(raw);
|
||||
Array<Scalar,3,1> a(raw);
|
||||
VERIFY(m(0) == 1);
|
||||
VERIFY(m(1) == 2);
|
||||
VERIFY(m(2) == 3);
|
||||
VERIFY(a(0) == 1);
|
||||
VERIFY(a(1) == 2);
|
||||
VERIFY(a(2) == 3);
|
||||
}
|
||||
|
||||
void test_basicstuff()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
@ -210,5 +224,9 @@ void test_basicstuff()
|
||||
CALL_SUBTEST_5( basicStuffComplex(MatrixXcd(internal::random<int>(1,100), internal::random<int>(1,100))) );
|
||||
}
|
||||
|
||||
CALL_SUBTEST_1(fixedSizeMatrixConstruction<unsigned char>());
|
||||
CALL_SUBTEST_1(fixedSizeMatrixConstruction<double>());
|
||||
CALL_SUBTEST_1(fixedSizeMatrixConstruction<double>());
|
||||
|
||||
CALL_SUBTEST_2(casting());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user