mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 21:30:35 +08:00
clang-tidy trivial cleanup
This commit is contained in:
+13
-11
@@ -1,9 +1,11 @@
|
||||
#include <matrix/math.hpp>
|
||||
#include "test_macros.hpp"
|
||||
#include <matrix/math.hpp>
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
template class Matrix<float, 3, 3>;
|
||||
using matrix::Matrix;
|
||||
using matrix::Matrix3f;
|
||||
using matrix::Scalar;
|
||||
using matrix::Vector;
|
||||
using matrix::Vector2f;
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -24,7 +26,7 @@ int main()
|
||||
Matrix3f m2(data);
|
||||
|
||||
for(int i=0; i<9; i++) {
|
||||
TEST(fabs(data[i] - m2.data()[i]) < 1e-6f);
|
||||
TEST(fabsf(data[i] - m2.data()[i]) < 1e-6f);
|
||||
}
|
||||
|
||||
float data2d[3][3] = {
|
||||
@@ -34,7 +36,7 @@ int main()
|
||||
};
|
||||
m2 = Matrix3f(data2d);
|
||||
for(int i=0; i<9; i++) {
|
||||
TEST(fabs(data[i] - m2.data()[i]) < 1e-6f);
|
||||
TEST(fabsf(data[i] - m2.data()[i]) < 1e-6f);
|
||||
}
|
||||
|
||||
float data_times_2[9] = {2, 4, 6, 8, 10, 12, 14, 16, 18};
|
||||
@@ -96,17 +98,17 @@ int main()
|
||||
m4.swapCols(2, 2);
|
||||
TEST(isEqual(m4, Matrix3f(data)));
|
||||
|
||||
TEST(fabs(m4.min() - 1) < 1e-5);
|
||||
TEST(fabs((-m4).min() + 9) < 1e-5);
|
||||
TEST(fabsf(m4.min() - 1) < 1e-5);
|
||||
TEST(fabsf((-m4).min() + 9) < 1e-5);
|
||||
|
||||
Scalar<float> s;
|
||||
s = 1;
|
||||
const Vector<float, 1> & s_vect = s;
|
||||
TEST(fabs(s - 1) < 1e-5);
|
||||
TEST(fabs(s_vect(0) - 1.0f) < 1e-5);
|
||||
TEST(fabsf(s - 1) < 1e-5);
|
||||
TEST(fabsf(s_vect(0) - 1.0f) < 1e-5);
|
||||
|
||||
Matrix<float, 1, 1> m5 = s;
|
||||
TEST(fabs(m5(0,0) - s) < 1e-5);
|
||||
TEST(fabsf(m5(0,0) - s) < 1e-5);
|
||||
|
||||
Matrix<float, 2, 2> m6;
|
||||
m6.setRow(0, Vector2f(1, 2));
|
||||
|
||||
Reference in New Issue
Block a user