mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-12 01:57:35 +08:00
expm testing and fixes.
This commit is contained in:
+9
-3
@@ -12,12 +12,18 @@ template class SquareMatrix<float, n_large>;
|
||||
|
||||
int main()
|
||||
{
|
||||
float data[9] = {1, 0, 0, 0, 1, 0, 1, 0, 1};
|
||||
float data[9] = {1, 2, 3,
|
||||
4, 5, 6,
|
||||
7, 8, 10};
|
||||
float data_check[9] = {-0.66666667f, -1.33333333f, 1. ,
|
||||
-0.66666667f, 3.66666667f, -2. ,
|
||||
1. , -2. , 1. };
|
||||
|
||||
SquareMatrix<float, 3> A(data);
|
||||
SquareMatrix<float, 3> A_I = A.inverse();
|
||||
float data_check[9] = {1, 0, 0, 0, 1, 0, -1, 0, 1};
|
||||
SquareMatrix<float, 3> A_I_check(data_check);
|
||||
(void)A_I;
|
||||
A_I.print();
|
||||
A_I_check.print();
|
||||
assert(A_I == A_I_check);
|
||||
|
||||
// stess test
|
||||
|
||||
Reference in New Issue
Block a user