Implements some missing functions

See merge request oss/rotgen!28
This commit is contained in:
Joel Falcou 2025-09-28 16:15:15 +02:00
parent 5d8a084070
commit b6fcd4b341
34 changed files with 972 additions and 139 deletions

View file

@ -35,13 +35,28 @@ TTS_CASE_TPL("Dynamic matrix constructor with row and columns", rotgen::tests::t
TTS_EQUAL(matrix.cols(), rotgen::Index{5});
};
TTS_CASE_TPL("Static matrix constructor with row and columns", rotgen::tests::types)
<typename T, typename O>( tts::type< tts::types<T,O>> )
TTS_CASE_TPL("Static matrix constructor with row and columns", float, double)
<typename T>( tts::type<T> )
{
rotgen::matrix<T,6,11,O::value> matrix(6, 11);
rotgen::matrix<T,1,2> v2(6, 11);
rotgen::matrix<T,2,1> w2(6, 11);
TTS_EQUAL(matrix.rows(), rotgen::Index{6});
TTS_EQUAL(matrix.cols(), rotgen::Index{11});
TTS_EQUAL(v2(0), T{6});
TTS_EQUAL(v2(1), T{11});
TTS_EQUAL(w2(0), T{6});
TTS_EQUAL(w2(1), T{11});
rotgen::matrix<T,1,3> v3(6, 11, 125);
rotgen::matrix<T,3,1> w3(6, 11, 125);
TTS_EQUAL(v3(0), T{6});
TTS_EQUAL(v3(1), T{11});
TTS_EQUAL(v3(2), T{125});
TTS_EQUAL(w3(0), T{6});
TTS_EQUAL(w3(1), T{11});
TTS_EQUAL(w3(2), T{125});
};
TTS_CASE_TPL("Copy constructor produces identical but independent matrix", rotgen::tests::types)