mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 22:20:34 +08:00
define FLT_EPSILON; be descriptive about upper_right_triangle() method
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#include "test_macros.hpp"
|
||||
#include <matrix/math.hpp>
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
int main()
|
||||
{
|
||||
float data[9] = {1, 2, 3,
|
||||
4, 5, 6,
|
||||
7, 8, 10
|
||||
};
|
||||
float urt[6] = {1, 2, 3, 5, 6, 10};
|
||||
|
||||
SquareMatrix<float, 3> A(data);
|
||||
|
||||
for(int i=0; i<6; i++) {
|
||||
TEST(fabs(urt[i] - A.upper_right_triangle().data()[i]) < FLT_EPSILON);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* vim: set et fenc=utf-8 ff=unix sts=0 sw=4 ts=4 : */
|
||||
Reference in New Issue
Block a user