- Refurbish block implementation to support nested block
- Add missing extractors
This commit is contained in:
parent
3fff326db9
commit
93a1404d9a
24 changed files with 1205 additions and 630 deletions
|
|
@ -21,19 +21,19 @@ TTS_CASE_TPL("Function size", rotgen::tests::types)
|
|||
// 1x12 dynamic block at (0,0)
|
||||
rotgen::matrix<T, rotgen::Dynamic, rotgen::Dynamic, O::value> dm(1,12);
|
||||
fill(dm,1,12);
|
||||
auto b1 = rotgen::block<decltype(dm), rotgen::Dynamic, rotgen::Dynamic, false, O::value>(dm, 0,0,1,12);
|
||||
auto b1 = rotgen::block<decltype(dm), rotgen::Dynamic, rotgen::Dynamic>(dm, 0,0,1,12);
|
||||
TTS_EQUAL(b1.rows(), rotgen::Index{1});
|
||||
TTS_EQUAL(b1.cols(), rotgen::Index{12});
|
||||
|
||||
// 1x5 dynamic block at (0,2)
|
||||
auto b2 = rotgen::block<decltype(dm), rotgen::Dynamic, rotgen::Dynamic, false, O::value>(dm, 0,2,1,5);
|
||||
auto b2 = rotgen::block<decltype(dm), rotgen::Dynamic, rotgen::Dynamic>(dm, 0,2,1,5);
|
||||
TTS_EQUAL(b2.rows(), rotgen::Index{1});
|
||||
TTS_EQUAL(b2.cols(), rotgen::Index{5});
|
||||
|
||||
// 3x2 dynamic block at (1,4) in 4x6
|
||||
rotgen::matrix<T, rotgen::Dynamic, rotgen::Dynamic, O::value> dm2(4,6);
|
||||
fill(dm2,4,6);
|
||||
auto b3 = rotgen::block<decltype(dm2), rotgen::Dynamic, rotgen::Dynamic, false, O::value>(dm2, 1,4,3,2);
|
||||
auto b3 = rotgen::block<decltype(dm2), rotgen::Dynamic, rotgen::Dynamic>(dm2, 1,4,3,2);
|
||||
TTS_EQUAL(b3.rows(), rotgen::Index{3});
|
||||
TTS_EQUAL(b3.cols(), rotgen::Index{2});
|
||||
TTS_EQUAL(b3.size(), rotgen::Index{6});
|
||||
|
|
@ -41,7 +41,7 @@ TTS_CASE_TPL("Function size", rotgen::tests::types)
|
|||
// 3x4 static block
|
||||
rotgen::matrix<T,3,4,O::value> sm;
|
||||
fill(sm,3,4);
|
||||
auto b4 = rotgen::block<decltype(sm), 3, 4, false, O::value>(sm, 0,0);
|
||||
auto b4 = rotgen::block<decltype(sm), 3, 4>(sm, 0,0);
|
||||
TTS_EQUAL(b4.rows(), rotgen::Index{3});
|
||||
TTS_EQUAL(b4.cols(), rotgen::Index{4});
|
||||
TTS_EQUAL(b4.size(), rotgen::Index{12});
|
||||
|
|
@ -49,7 +49,7 @@ TTS_CASE_TPL("Function size", rotgen::tests::types)
|
|||
// 6x2 static block
|
||||
rotgen::matrix<T,6,2,O::value> sm2;
|
||||
fill(sm2,6,2);
|
||||
auto b5 = rotgen::block<decltype(sm2), 6, 2, false, O::value>(sm2, 0,0);
|
||||
auto b5 = rotgen::block<decltype(sm2), 6, 2>(sm2, 0,0);
|
||||
TTS_EQUAL(b5.rows(), rotgen::Index{6});
|
||||
TTS_EQUAL(b5.cols(), rotgen::Index{2});
|
||||
TTS_EQUAL(b5.size(), rotgen::Index{12});
|
||||
|
|
@ -64,7 +64,7 @@ TTS_CASE_TPL("Test coefficient accessors", rotgen::tests::types)
|
|||
base mat(4,3);
|
||||
for(int k=0;k<12;++k) mat.data()[k] = data[k];
|
||||
|
||||
auto b = rotgen::block<base,rotgen::Dynamic,rotgen::Dynamic,false,O::value>(mat, 0, 0, 4, 3);
|
||||
auto b = rotgen::block<base,rotgen::Dynamic,rotgen::Dynamic>(mat, 0, 0, 4, 3);
|
||||
for(rotgen::Index i=0;i<4;i++)
|
||||
{
|
||||
for(rotgen::Index j=0;j<3;j++)
|
||||
|
|
@ -91,7 +91,7 @@ TTS_CASE_TPL("Test one index coefficient accessors", rotgen::tests::types)
|
|||
base mat(4,3);
|
||||
for(int k=0;k<12;++k) mat.data()[k] = data[k];
|
||||
|
||||
auto b = rotgen::block<base,rotgen::Dynamic,rotgen::Dynamic,false,O::value>(mat, 0, 0, 4, 3);
|
||||
auto b = rotgen::block<base,rotgen::Dynamic,rotgen::Dynamic>(mat, 0, 0, 4, 3);
|
||||
for(rotgen::Index i=0;i<b.size();i++)
|
||||
TTS_EQUAL(b(i), data[i]) << "Index: " << i << "\n";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue