Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
add test to .urt()
Browse files Browse the repository at this point in the history
  • Loading branch information
TSC21 committed Feb 17, 2019
1 parent fbef579 commit 14630d5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set(tests
hatvee
copyto
least_squares
urt
)

add_custom_target(test_build)
Expand Down
24 changes: 24 additions & 0 deletions test/urt.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#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<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 : */

0 comments on commit 14630d5

Please sign in to comment.