mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
29
base/base_tests/matrix_test.cpp
Normal file
29
base/base_tests/matrix_test.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "testing/testing.hpp"
|
||||
|
||||
#include "base/matrix.hpp"
|
||||
|
||||
|
||||
UNIT_TEST(Matrix_Inverse_Simple)
|
||||
{
|
||||
math::Matrix<double, 3, 3> m;
|
||||
|
||||
m = math::Identity<double, 3>();
|
||||
|
||||
m(2, 0) = 2;
|
||||
|
||||
math::Matrix<double, 3, 3> m1 = math::Inverse(m);
|
||||
|
||||
TEST_EQUAL((m1 * m).Equal(math::Identity<double, 3>()), true, ());
|
||||
}
|
||||
|
||||
UNIT_TEST(Matrix_Inverse_AllElementsNonZero)
|
||||
{
|
||||
math::Matrix<double, 3, 3> m;
|
||||
m(0, 0) = 5; m(0, 1) = 3; m(0, 2) = 6;
|
||||
m(1, 0) = 1; m(1, 1) = 7; m(1, 2) = 9;
|
||||
m(2, 0) = 2; m(2, 1) = 13; m(2, 2) = 4;
|
||||
|
||||
math::Matrix<double, 3, 3> m1 = math::Inverse(m);
|
||||
|
||||
TEST_EQUAL((m1 * m).Equal(math::Identity<double, 3>()), true, ());
|
||||
}
|
||||
Reference in New Issue
Block a user