[TEST][ARITHMETICS] added tests for the operator+
This commit is contained in:
parent
0794c818c9
commit
ec63380746
1 changed files with 23 additions and 0 deletions
|
|
@ -29,3 +29,26 @@ TTS_CASE("Check operator*")
|
||||||
a *= 10.5;
|
a *= 10.5;
|
||||||
TTS_EQUAL(a, ref);
|
TTS_EQUAL(a, ref);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TTS_CASE("Check operator matrix + matrix")
|
||||||
|
{
|
||||||
|
rotgen::matrix<double> mat1(3,4);
|
||||||
|
rotgen::matrix<double> mat2(3,4);
|
||||||
|
rotgen::matrix<double> mat_sum(3,4);
|
||||||
|
|
||||||
|
for(std::size_t r=0;r<mat1.rows();r++)
|
||||||
|
{
|
||||||
|
for(std::size_t c=0;c<mat1.cols();c++)
|
||||||
|
{
|
||||||
|
mat1(r,c) = r + 2 * c + 3;
|
||||||
|
mat2(r,c) = r - c - 54;
|
||||||
|
mat_sum(r,c) = 2 * r + c - 51;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TTS_EQUAL(mat1 + mat2, mat_sum);
|
||||||
|
TTS_EQUAL(mat2 + mat1, mat_sum);
|
||||||
|
|
||||||
|
mat1 += mat2;
|
||||||
|
TTS_EQUAL(mat1, mat_sum);
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue