Added more operators + tests
This commit is contained in:
parent
5f1d070547
commit
682202825e
4 changed files with 68 additions and 10 deletions
|
|
@ -21,6 +21,6 @@ TTS_CASE("Sample test")
|
|||
"0 0 0 0 0\n"
|
||||
"0 0 0 0 0\n"
|
||||
"0 0 0 0 0";
|
||||
|
||||
|
||||
TTS_EQUAL(os.str(), ref);
|
||||
};
|
||||
31
test/basic/operators.cpp
Normal file
31
test/basic/operators.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//==================================================================================================
|
||||
/*
|
||||
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);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue