//================================================================================================== /* ROTGEN - Runtime Overlay for Eigen Copyright : CODE RECKONS SPDX-License-Identifier: BSL-1.0 */ //================================================================================================== #include "unit/tests.hpp" #include "unit/common/norms.hpp" #include TTS_CASE_TPL("Test dynamic block norm operations", rotgen::tests::types) ( tts::type< tts::types> ) { auto const cases = rotgen::tests::generate_block_references(); for (const auto& [matrix_desc, i0, j0, ni, nj] : cases) { auto[rows,cols,fn] = matrix_desc; rotgen::matrix m(rows, cols); rotgen::tests::prepare(rows,cols,fn,m); auto input = rotgen::extract(m, i0, j0, ni, nj); rotgen::tests::check_norms_functions(input); } }; TTS_CASE_TPL("Test static block norm operations", rotgen::tests::types) ( tts::type< tts::types> ) { auto const cases = rotgen::tests::generate_static_block_references(); auto process = [](D const& d) { auto[desc,i0,j0] = d; auto[rows,cols,fn] = desc; rotgen::matrix m(rows, cols); rotgen::tests::prepare(rows,cols,fn,m); auto input = rotgen::extract(m, i0, j0); rotgen::tests::check_norms_functions(input); }; std::apply([&](auto const&... d) { (process(d),...);}, cases); };