//================================================================================================== /* ROTGEN - Runtime Overlay for Eigen Copyright : CODE RECKONS SPDX-License-Identifier: BSL-1.0 */ //================================================================================================== #include "unit/tests.hpp" #include TTS_CASE_TPL("noalias behavior - dynamicallly sized", rotgen::tests::types) ( tts::type< tts::types> ) { rotgen::matrix a{{1,2},{3,4}}; rotgen::matrix ref{{7,10},{15,22}}; rotgen::matrix b(2,2),c(2,2),d(2,2); rotgen::noalias(b) = a * a; TTS_EQUAL(b, ref); auto e = rotgen::extract(c,0,0,2,2); rotgen::noalias(e) = a * a; TTS_EQUAL(c, ref); rotgen::map> m(d.data(),2,2); rotgen::noalias(m) = a * a; TTS_EQUAL(m, ref); }; TTS_CASE_TPL("noalias behavior - statically sized", rotgen::tests::types) ( tts::type< tts::types> ) { rotgen::matrix a{{1,2},{3,4}}; rotgen::matrix ref{{7,10},{15,22}}; rotgen::matrix b,c,d; rotgen::noalias(b) = a * a; TTS_EQUAL(b, ref); auto e = rotgen::extract(c,0,0,2,2); rotgen::noalias(e) = a * a; TTS_EQUAL(c, ref); rotgen::map> m(d.data()); rotgen::noalias(m) = a * a; TTS_EQUAL(m, ref); };