PX4 Firmware
PX4 Autopilot Software http://px4.io
vectorAssignment.cpp
Go to the documentation of this file.
1 #include <matrix/math.hpp>
2 
3 #include "test_macros.hpp"
4 
5 using namespace matrix;
6 
7 int main()
8 {
9  Vector3f v;
10  v(0) = 1;
11  v(1) = 2;
12  v(2) = 3;
13 
14  static const float eps = 1e-7f;
15 
16  TEST(fabs(v(0) - 1) < eps);
17  TEST(fabs(v(1) - 2) < eps);
18  TEST(fabs(v(2) - 3) < eps);
19 
20  Vector3f v2(4, 5, 6);
21 
22  TEST(fabs(v2(0) - 4) < eps);
23  TEST(fabs(v2(1) - 5) < eps);
24  TEST(fabs(v2(2) - 6) < eps);
25 
27  TEST(fabs(m(0, 0) - 1) < eps);
28  TEST(fabs(m(1, 1) - 2) < eps);
29  TEST(fabs(m(2, 2) - 3) < eps);
30 
31  return 0;
32 }
33 
34 /* vim: set et fenc=utf-8 ff=unix sts=0 sw=4 ts=4 : */
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
Definition: integration.cpp:8
SquareMatrix< Type, M > diag(Vector< Type, M > d)
Vector3< float > Vector3f
Definition: Vector3.hpp:136
#define TEST(X)
Definition: test_macros.hpp:14
int main()