Resolve "[API-#2] Pseudo-privatization of rotgen entity member functions"

Closes #18

Co-authored-by: Jules Pénuchot <jules@penuchot.com>

See merge request oss/rotgen!50
This commit is contained in:
Jules Pénuchot 2025-12-17 20:48:00 +01:00 committed by Joel Falcou
parent 6489697c05
commit e151e136d6
52 changed files with 2212 additions and 1556 deletions

View file

@ -14,34 +14,34 @@ TTS_CASE_TPL("Chains of extraction", rotgen::tests::types)
<typename T, typename O>(tts::type<tts::types<T, O>>)
{
constexpr int N = 8;
auto a = rotgen::matrix<T, N, N, O::value>::Random();
auto a = rotgen::setRandom<rotgen::matrix<T, N, N, O::value>>();
auto b = topLeftCorner(a, 5, 5);
TTS_EQUAL(b.startRow(), 0);
TTS_EQUAL(b.startCol(), 0);
TTS_EQUAL(startRow(b), 0);
TTS_EQUAL(startCol(b), 0);
setConstant(b, -7);
for (rotgen::Index r = 0; r < 5; r++)
for (rotgen::Index c = 0; c < 5; c++) TTS_EQUAL(a(r, c), -7);
auto bb = bottomRightCorner(b, 3, 3);
TTS_EQUAL(bb.startRow(), 2);
TTS_EQUAL(bb.startCol(), 2);
TTS_EQUAL(startRow(bb), 2);
TTS_EQUAL(startCol(bb), 2);
setConstant(bb, 42);
for (rotgen::Index r = 2; r < 5; r++)
for (rotgen::Index c = 2; c < 5; c++) TTS_EQUAL(a(r, c), 42);
auto bbb = row(bb, 1);
TTS_EQUAL(bbb.startRow(), 1);
TTS_EQUAL(bbb.startCol(), 0);
TTS_EQUAL(startRow(bbb), 1);
TTS_EQUAL(startCol(bbb), 0);
setConstant(bbb, 99.5);
for (rotgen::Index c = 3; c < 5; c++) TTS_EQUAL(a(3, c), 99.5);
auto bbbb = col(bbb, 1);
TTS_EQUAL(bbbb.startRow(), 0);
TTS_EQUAL(bbbb.startCol(), 1);
TTS_EQUAL(startRow(bbbb), 0);
TTS_EQUAL(startCol(bbbb), 1);
setConstant(bbbb, 0.125);
TTS_EQUAL(a(3, 3), 0.125);
@ -94,7 +94,7 @@ TTS_CASE("Compound operators on extractions")
setConstant(n, 10);
setConstant(reference, 10);
for (int i = 0; i < m.cols(); i++) process_col(m, n, i);
for (int i = 0; i < cols(m); i++) process_col(m, n, i);
TTS_EQUAL(m, reference);
};