rotgen/test/basic/operators.cpp
2025-05-12 11:33:38 +02:00

31 lines
No EOL
727 B
C++

//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#define TTS_MAIN
#include <rotgen/matrix.hpp>
#include "tts.hpp"
TTS_CASE("Check operator*")
{
rotgen::matrix<double> a(2,2);
rotgen::matrix<double> ref(2,2);
for(int r=0;r<a.rows();r++)
{
for(int c=0;c<a.cols();c++)
{
a(r,c) = (1+c) + 10*(1+r);
ref(r,c) = ((1+c) + 10*(1+r)) * 10.5;
}
}
TTS_EQUAL(a * 10.5, ref);
TTS_EQUAL(10.5 * a, ref);
a *= 10.5;
TTS_EQUAL(a, ref);
};