add test to .urt()

This commit is contained in:
TSC21 2019-02-17 18:18:26 +00:00 committed by Nuno Marques
parent 210c76c04b
commit 707967d117
2 changed files with 25 additions and 0 deletions

View File

@ -18,6 +18,7 @@ set(tests
hatvee
copyto
least_squares
urt
)
add_custom_target(test_build)

24
test/urt.cpp Normal file
View 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 : */