PX4 Firmware
PX4 Autopilot Software http://px4.io
upperRightTriangle.cpp
Go to the documentation of this file.
1 #include "test_macros.hpp"
2 #include <matrix/math.hpp>
3 
4 using namespace matrix;
5 
6 int main()
7 {
8  float data[9] = {1, 2, 3,
9  4, 5, 6,
10  7, 8, 10
11  };
12  float urt[6] = {1, 2, 3, 5, 6, 10};
13 
14  SquareMatrix<float, 3> A(data);
15 
16  for(size_t i=0; i<6; i++) {
17  TEST(fabs(urt[i] - A.upper_right_triangle()(i)) < FLT_EPSILON);
18  }
19 
20  return 0;
21 }
22 
23 /* vim: set et fenc=utf-8 ff=unix sts=0 sw=4 ts=4 : */
#define FLT_EPSILON
uint8_t * data
Definition: dataman.cpp:149
#define TEST(X)
Definition: test_macros.hpp:14
int main()
Vector< Type, M *(M+1)/2 > upper_right_triangle() const