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:
parent
6489697c05
commit
e151e136d6
52 changed files with 2212 additions and 1556 deletions
|
|
@ -48,9 +48,9 @@ void test_random(auto const& matrix,
|
|||
}
|
||||
}
|
||||
|
||||
TTS_CASE_TPL("Test dynamic block::setZero",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
TTS_CASE_TPL("Test dynamic block::setZero", rotgen::tests::types)
|
||||
|
||||
<typename T, typename O>(tts::type<tts::types<T, O>>)
|
||||
{
|
||||
auto const cases = rotgen::tests::generate_block_references<T, O>();
|
||||
for (auto const& [matrix_desc, i0, j0, ni, nj] : cases)
|
||||
|
|
@ -64,14 +64,14 @@ TTS_CASE_TPL("Test dynamic block::setZero",
|
|||
test_value(m, T{0}, i0, j0, ni, nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract(m, i0, j0, ni, nj));
|
||||
auto values = input_type::Zero(ni, nj);
|
||||
auto values = rotgen::setZero<input_type>(ni, nj);
|
||||
test_value(values, T{0}, 0, 0, ni, nj);
|
||||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test static block::setZero",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
TTS_CASE_TPL("Test static block::setZero", rotgen::tests::types)
|
||||
|
||||
<typename T, typename O>(tts::type<tts::types<T, O>>)
|
||||
{
|
||||
auto const cases = rotgen::tests::generate_static_block_references<T, O>();
|
||||
|
||||
|
|
@ -87,16 +87,16 @@ TTS_CASE_TPL("Test static block::setZero",
|
|||
test_value(m, T{0}, i0, j0, D::ni, D::nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract<D::ni, D::nj>(m, i0, j0));
|
||||
auto values = input_type::Zero();
|
||||
auto values = rotgen::setZero<input_type>();
|
||||
test_value(values, T{0}, 0, 0, D::ni, D::nj);
|
||||
};
|
||||
|
||||
std::apply([&](auto const&... d) { (process(d), ...); }, cases);
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test dynamic block::setOnes",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
TTS_CASE_TPL("Test dynamic block::setOnes", rotgen::tests::types)
|
||||
|
||||
<typename T, typename O>(tts::type<tts::types<T, O>>)
|
||||
{
|
||||
auto const cases = rotgen::tests::generate_block_references<T, O>();
|
||||
for (auto const& [matrix_desc, i0, j0, ni, nj] : cases)
|
||||
|
|
@ -110,14 +110,14 @@ TTS_CASE_TPL("Test dynamic block::setOnes",
|
|||
test_value(m, T{1}, i0, j0, ni, nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract(m, i0, j0, ni, nj));
|
||||
auto values = input_type::Ones(ni, nj);
|
||||
auto values = rotgen::setOnes<input_type>(ni, nj);
|
||||
test_value(values, T{1}, 0, 0, ni, nj);
|
||||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test static block::setOnes",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
TTS_CASE_TPL("Test static block::setOnes", rotgen::tests::types)
|
||||
|
||||
<typename T, typename O>(tts::type<tts::types<T, O>>)
|
||||
{
|
||||
auto const cases = rotgen::tests::generate_static_block_references<T, O>();
|
||||
|
||||
|
|
@ -133,16 +133,16 @@ TTS_CASE_TPL("Test static block::setOnes",
|
|||
test_value(m, T{1}, i0, j0, D::ni, D::nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract<D::ni, D::nj>(m, i0, j0));
|
||||
auto values = input_type::Ones();
|
||||
auto values = rotgen::setOnes<input_type>();
|
||||
test_value(values, T{1}, 0, 0, D::ni, D::nj);
|
||||
};
|
||||
|
||||
std::apply([&](auto const&... d) { (process(d), ...); }, cases);
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test dynamic block::setConstant",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
TTS_CASE_TPL("Test dynamic block::setConstant", rotgen::tests::types)
|
||||
|
||||
<typename T, typename O>(tts::type<tts::types<T, O>>)
|
||||
{
|
||||
auto const cases = rotgen::tests::generate_block_references<T, O>();
|
||||
for (auto const& [matrix_desc, i0, j0, ni, nj] : cases)
|
||||
|
|
@ -156,14 +156,14 @@ TTS_CASE_TPL("Test dynamic block::setConstant",
|
|||
test_value(m, T{13.37f}, i0, j0, ni, nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract(m, i0, j0, ni, nj));
|
||||
auto values = input_type::Constant(ni, nj, T{13.37f});
|
||||
auto values = rotgen::setConstant<input_type>(ni, nj, T{13.37f});
|
||||
test_value(values, T{13.37f}, 0, 0, ni, nj);
|
||||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test static block::setConstant",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
TTS_CASE_TPL("Test static block::setConstant", rotgen::tests::types)
|
||||
|
||||
<typename T, typename O>(tts::type<tts::types<T, O>>)
|
||||
{
|
||||
auto const cases = rotgen::tests::generate_static_block_references<T, O>();
|
||||
|
||||
|
|
@ -179,16 +179,16 @@ TTS_CASE_TPL("Test static block::setConstant",
|
|||
test_value(m, T{13.37f}, i0, j0, D::ni, D::nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract<D::ni, D::nj>(m, i0, j0));
|
||||
auto values = input_type::Constant(T{13.37f});
|
||||
auto values = rotgen::setConstant<input_type>(T{13.37f});
|
||||
test_value(values, T{13.37f}, 0, 0, D::ni, D::nj);
|
||||
};
|
||||
|
||||
std::apply([&](auto const&... d) { (process(d), ...); }, cases);
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test dynamic block::setIdentity",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
TTS_CASE_TPL("Test dynamic block::setIdentity", rotgen::tests::types)
|
||||
|
||||
<typename T, typename O>(tts::type<tts::types<T, O>>)
|
||||
{
|
||||
auto const cases = rotgen::tests::generate_block_references<T, O>();
|
||||
for (auto const& [matrix_desc, i0, j0, ni, nj] : cases)
|
||||
|
|
@ -202,14 +202,14 @@ TTS_CASE_TPL("Test dynamic block::setIdentity",
|
|||
test_identity(m, i0, j0, ni, nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract(m, i0, j0, ni, nj));
|
||||
auto values = input_type::Identity(ni, nj);
|
||||
auto values = rotgen::setIdentity<input_type>(ni, nj);
|
||||
test_identity(values, 0, 0, ni, nj);
|
||||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test static block::setIdentity",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
TTS_CASE_TPL("Test static block::setIdentity", rotgen::tests::types)
|
||||
|
||||
<typename T, typename O>(tts::type<tts::types<T, O>>)
|
||||
{
|
||||
auto const cases = rotgen::tests::generate_static_block_references<T, O>();
|
||||
|
||||
|
|
@ -225,16 +225,16 @@ TTS_CASE_TPL("Test static block::setIdentity",
|
|||
test_identity(m, i0, j0, D::ni, D::nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract<D::ni, D::nj>(m, i0, j0));
|
||||
auto values = input_type::Identity();
|
||||
auto values = rotgen::setIdentity<input_type>();
|
||||
test_identity(values, 0, 0, D::ni, D::nj);
|
||||
};
|
||||
|
||||
std::apply([&](auto const&... d) { (process(d), ...); }, cases);
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test dynamic block::setRandom",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
TTS_CASE_TPL("Test dynamic block::setRandom", rotgen::tests::types)
|
||||
|
||||
<typename T, typename O>(tts::type<tts::types<T, O>>)
|
||||
{
|
||||
auto const cases = rotgen::tests::generate_block_references<T, O>();
|
||||
for (auto const& [matrix_desc, i0, j0, ni, nj] : cases)
|
||||
|
|
@ -248,14 +248,14 @@ TTS_CASE_TPL("Test dynamic block::setRandom",
|
|||
test_random(m, i0, j0, ni, nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract(m, i0, j0, ni, nj));
|
||||
auto values = input_type::Random(ni, nj);
|
||||
auto values = rotgen::setRandom<input_type>(ni, nj);
|
||||
test_random(values, 0, 0, ni, nj);
|
||||
}
|
||||
};
|
||||
|
||||
TTS_CASE_TPL("Test static block::setRandom",
|
||||
rotgen::tests::types)<typename T, typename O>(
|
||||
tts::type<tts::types<T, O>>)
|
||||
TTS_CASE_TPL("Test static block::setRandom", rotgen::tests::types)
|
||||
|
||||
<typename T, typename O>(tts::type<tts::types<T, O>>)
|
||||
{
|
||||
auto const cases = rotgen::tests::generate_static_block_references<T, O>();
|
||||
|
||||
|
|
@ -271,7 +271,7 @@ TTS_CASE_TPL("Test static block::setRandom",
|
|||
test_random(m, i0, j0, D::ni, D::nj);
|
||||
|
||||
using input_type = decltype(rotgen::extract<D::ni, D::nj>(m, i0, j0));
|
||||
auto values = input_type::Random();
|
||||
auto values = rotgen::setRandom<input_type>();
|
||||
test_random(values, 0, 0, D::ni, D::nj);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue