mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
add test to .urt()
This commit is contained in:
parent
210c76c04b
commit
707967d117
@ -18,6 +18,7 @@ set(tests
|
||||
hatvee
|
||||
copyto
|
||||
least_squares
|
||||
urt
|
||||
)
|
||||
|
||||
add_custom_target(test_build)
|
||||
|
||||
24
test/urt.cpp
Normal file
24
test/urt.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include "test_macros.hpp"
|
||||
#include "float.h"
|
||||
#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<sizeof(urt); i++) {
|
||||
TEST(fabs(urt[i] - A.urt().data()[i]) < FLT_EPSILON);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* vim: set et fenc=utf-8 ff=unix sts=0 sw=4 ts=4 : */
|
||||
Loading…
x
Reference in New Issue
Block a user