//================================================================================================== /* ROTGEN - Runtime Overlay for Eigen Copyright : CODE RECKONS SPDX-License-Identifier: BSL-1.0 */ //================================================================================================== #include #include "unit/common/norms.hpp" #include "unit/common/references.hpp" #include "unit/tests.hpp" TTS_CASE_TPL("Test dynamic map norm operations", rotgen::tests::types)( tts::type>) { auto const cases = rotgen::tests::generate_matrix_references(); for (auto const& [rows, cols, fn] : cases) { rotgen::matrix base(rows, cols); rotgen::tests::prepare(rows, cols, fn, base); rotgen::map> input(base.data(), rows, cols); rotgen::tests::check_norms_functions(input); } }; TTS_CASE_TPL("Test static map norm operations", rotgen::tests::types)( tts::type>) { auto const cases = rotgen::tests::generate_static_matrix_references(); auto process = [](D const& desc) { rotgen::matrix base(D::rows, D::cols); rotgen::tests::prepare(base.rows(), base.cols(), desc.init_fn, base); rotgen::map> input( base.data()); rotgen::tests::check_norms_functions(input); }; std::apply([&](auto const&... d) { (process(d), ...); }, cases); };