Browse Source

clang-tidy trivial cleanup

master
Daniel Agar 8 years ago
parent
commit
cfa68c2196
  1. 9
      .clang-tidy
  2. 16
      CMakeLists.txt
  3. 2
      matrix/AxisAngle.hpp
  4. 2
      matrix/Dcm.hpp
  5. 26
      matrix/Matrix.hpp
  6. 6
      matrix/Scalar.hpp
  7. 6
      matrix/SquareMatrix.hpp
  8. 2
      matrix/Vector.hpp
  9. 7
      matrix/helper_functions.hpp
  10. 45
      test/attitude.cpp
  11. 10
      test/filter.cpp
  12. 9
      test/hatvee.cpp
  13. 10
      test/helper.cpp
  14. 12
      test/integration.cpp
  15. 10
      test/inverse.cpp
  16. 24
      test/matrixAssignment.cpp
  17. 7
      test/matrixMult.cpp
  18. 5
      test/matrixScalarMult.cpp
  19. 15
      test/setIdentity.cpp
  20. 7
      test/slice.cpp
  21. 6
      test/squareMatrix.cpp
  22. 9
      test/transpose.cpp
  23. 8
      test/vector.cpp
  24. 25
      test/vector2.cpp
  25. 31
      test/vector3.cpp
  26. 23
      test/vectorAssignment.cpp

9
.clang-tidy

@ -0,0 +1,9 @@
Checks: 'clang-diagnostic-*,clang-analyzer-*,*,
,-cppcoreguidelines-pro-type-vararg
,-cppcoreguidelines-pro-bounds-array-to-pointer-decay
,-cppcoreguidelines-pro-bounds-constant-array-index
,-cppcoreguidelines-pro-bounds-pointer-arithmetic
'
WarningsAsErrors: '*'
HeaderFilterRegex: '*.h, *.hpp, *.hh, *.hxx'

16
CMakeLists.txt

@ -6,6 +6,9 @@ set(VERSION_PATCH "2")
project(matrix CXX) project(matrix CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (NOT CMAKE_BUILD_TYPE) if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Build type" FORCE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Build type" FORCE)
message(STATUS "set build type to ${CMAKE_BUILD_TYPE}") message(STATUS "set build type to ${CMAKE_BUILD_TYPE}")
@ -65,7 +68,6 @@ add_compile_options(
-Wsign-conversion -Wsign-conversion
-Wsign-promo -Wsign-promo
-Wstrict-null-sentinel -Wstrict-null-sentinel
-Wstrict-overflow=5
-Wswitch-default -Wswitch-default
-Wundef -Wundef
-Wuninitialized -Wuninitialized
@ -74,7 +76,14 @@ add_compile_options(
# clang tolerate unknown gcc options # clang tolerate unknown gcc options
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options(-Wno-error=unused-command-line-argument-hard-error-in-future -Wno-unknown-warning-option) add_compile_options(
-Wno-error=unused-command-line-argument-hard-error-in-future
-Wno-unknown-warning-option
)
else()
add_compile_options(
-Wstrict-overflow=5
)
endif() endif()
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
@ -83,6 +92,9 @@ if(TESTING)
enable_testing() enable_testing()
add_subdirectory(test) add_subdirectory(test)
add_dependencies(check test_build) add_dependencies(check test_build)
add_custom_target(clang-tidy COMMAND clang-tidy -p . ${CMAKE_SOURCE_DIR}/test/*.cpp)
add_dependencies(clang-tidy test_build)
endif() endif()
if(FORMAT) if(FORMAT)

2
matrix/AxisAngle.hpp

@ -31,7 +31,7 @@ template<typename Type>
class AxisAngle : public Vector<Type, 3> class AxisAngle : public Vector<Type, 3>
{ {
public: public:
virtual ~AxisAngle() {}; ~AxisAngle() override = default;
typedef Matrix<Type, 3, 1> Matrix31; typedef Matrix<Type, 3, 1> Matrix31;

2
matrix/Dcm.hpp

@ -17,7 +17,6 @@
#include "math.hpp" #include "math.hpp"
namespace matrix namespace matrix
{ {
@ -30,7 +29,6 @@ class Euler;
template<typename Type> template<typename Type>
class AxisAngle; class AxisAngle;
/** /**
* Direction cosine matrix class * Direction cosine matrix class
* *

26
matrix/Matrix.hpp

@ -8,11 +8,10 @@
#pragma once #pragma once
#include <stdio.h> #include <cmath>
#include <stddef.h> #include <cstdio>
#include <stdlib.h> #include <cstring>
#include <string.h>
#include <math.h>
#if defined(SUPPORT_STDIOSTREAM) #if defined(SUPPORT_STDIOSTREAM)
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
@ -36,25 +35,20 @@ public:
virtual ~Matrix() {}; virtual ~Matrix() {};
Matrix() : // Constructors
_data() Matrix() : _data() {}
{
}
Matrix(const Type data_[][N]) : Matrix(const Type data_[][N]) : _data()
_data()
{ {
memcpy(_data, data_, sizeof(_data)); memcpy(_data, data_, sizeof(_data));
} }
Matrix(const Type *data_) : Matrix(const Type *data_) : _data()
_data()
{ {
memcpy(_data, data_, sizeof(_data)); memcpy(_data, data_, sizeof(_data));
} }
Matrix(const Matrix &other) : Matrix(const Matrix &other) : _data()
_data()
{ {
memcpy(_data, other._data, sizeof(_data)); memcpy(_data, other._data, sizeof(_data));
} }
@ -519,7 +513,7 @@ bool isEqualF(Type x,
bool equal = true; bool equal = true;
if (fabsf(x - y) > eps) { if (fabs(x - y) > eps) {
equal = false; equal = false;
} }

6
matrix/Scalar.hpp

@ -8,12 +8,6 @@
#pragma once #pragma once
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "math.hpp" #include "math.hpp"
namespace matrix namespace matrix

6
matrix/SquareMatrix.hpp

@ -8,12 +8,6 @@
#pragma once #pragma once
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "math.hpp" #include "math.hpp"
#include "helper_functions.hpp" #include "helper_functions.hpp"

2
matrix/Vector.hpp

@ -22,7 +22,7 @@ template<typename Type, size_t M>
class Vector : public Matrix<Type, M, 1> class Vector : public Matrix<Type, M, 1>
{ {
public: public:
virtual ~Vector() {}; ~Vector() override = default;
typedef Matrix<Type, M, 1> MatrixM1; typedef Matrix<Type, M, 1> MatrixM1;

7
matrix/helper_functions.hpp

@ -1,14 +1,7 @@
#pragma once #pragma once
#include "math.hpp" #include "math.hpp"
// grody hack - this should go once C++11 is supported
// on all platforms.
#if defined (__PX4_NUTTX) || defined (__PX4_QURT)
#include <math.h>
#else
#include <cmath> #include <cmath>
#endif
namespace matrix namespace matrix
{ {

45
test/attitude.cpp

@ -1,21 +1,20 @@
#include <cstdio>
#include <stdexcept>
#include <matrix/math.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/math.hpp>
using namespace matrix; using matrix::AxisAnglef;
using matrix::Dcm;
// important to list all classes here for coverage using matrix::Dcmf;
template class Quaternion<float>; using matrix::Euler;
template class Euler<float>; using matrix::Eulerf;
template class Dcm<float>; using matrix::eye;
template class AxisAngle<float>; using matrix::isEqualF;
template class Scalar<float>; using matrix::Matrix;
template class SquareMatrix<float, 2>; using matrix::Quaternion;
template class Vector<float, 3>; using matrix::Quatf;
template class Vector2<float>; using matrix::SquareMatrix;
template class Vector3<float>; using matrix::Vector3f;
using matrix::Vector;
using matrix::zeros;
int main() int main()
{ {
@ -51,10 +50,10 @@ int main()
// quaternion ctor // quaternion ctor
Quatf q0(1, 2, 3, 4); Quatf q0(1, 2, 3, 4);
Quatf q(q0); Quatf q(q0);
TEST(fabs(q(0) - 1) < eps); TEST(fabsf(q(0) - 1) < eps);
TEST(fabs(q(1) - 2) < eps); TEST(fabsf(q(1) - 2) < eps);
TEST(fabs(q(2) - 3) < eps); TEST(fabsf(q(2) - 3) < eps);
TEST(fabs(q(3) - 4) < eps); TEST(fabsf(q(3) - 4) < eps);
// quat normalization // quat normalization
q.normalize(); q.normalize();
@ -102,10 +101,12 @@ int main()
for (size_t i = 0; i < 1000; i++) { for (size_t i = 0; i < 1000; i++) {
A = R * A; A = R * A;
} }
A.renormalize(); A.renormalize();
float err = 0.0f; float err = 0.0f;
for (size_t row = 0; row < 3; row++) {
matrix::Vector3f rvec(A._data[row]); for (auto & row : A._data) {
Vector3f rvec(row);
err += fabsf(1.0f - rvec.length()); err += fabsf(1.0f - rvec.length());
} }
TEST(err < eps); TEST(err < eps);

10
test/filter.cpp

@ -1,9 +1,11 @@
#include <stdio.h>
#include <matrix/filter.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/filter.hpp>
using namespace matrix; using matrix::Matrix;
using matrix::kalman_correct;
using matrix::eye;
using matrix::SquareMatrix;
using matrix::Vector;
int main() int main()
{ {

9
test/hatvee.cpp

@ -1,11 +1,10 @@
#include <stdio.h>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/math.hpp> #include <matrix/math.hpp>
using namespace matrix; using matrix::Dcm;
using matrix::Euler;
template class SquareMatrix<float, 3>; using matrix::isEqual;
using matrix::Vector3;
int main() int main()
{ {

10
test/helper.cpp

@ -1,10 +1,10 @@
#include <stdio.h>
#include <matrix/helper_functions.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/helper_functions.hpp>
using namespace matrix; using matrix::isEqual;
using matrix::isEqualF;
using matrix::Vector3f;
using matrix::wrap_pi;
int main() int main()
{ {

12
test/integration.cpp

@ -1,13 +1,13 @@
#include <stdio.h>
#include <matrix/integration.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/integration.hpp>
using namespace matrix; using matrix::Matrix;
using matrix::ones;
using matrix::Vector;
Vector<float, 6> f(float t, const Matrix<float, 6, 1> & y, const Matrix<float, 3, 1> & u); Vector<float, 6> f(float t, const Matrix<float, 6, 1> & /*y*/, const Matrix<float, 3, 1> & /*u*/);
Vector<float, 6> f(float t, const Matrix<float, 6, 1> & y, const Matrix<float, 3, 1> & u) { Vector<float, 6> f(float t, const Matrix<float, 6, 1> & /*y*/, const Matrix<float, 3, 1> & /*u*/) {
float v = -sinf(t); float v = -sinf(t);
return v*ones<float, 6, 1>(); return v*ones<float, 6, 1>();
} }

10
test/inverse.cpp

@ -1,15 +1,11 @@
#include <stdio.h>
#include <matrix/math.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/math.hpp>
using namespace matrix; using matrix::SquareMatrix;
using matrix::zeros;
static const size_t n_large = 50; static const size_t n_large = 50;
template class SquareMatrix<float, 3>;
template class SquareMatrix<float, n_large>;
int main() int main()
{ {
float data[9] = {0, 2, 3, float data[9] = {0, 2, 3,

24
test/matrixAssignment.cpp

@ -1,9 +1,11 @@
#include <matrix/math.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/math.hpp>
using namespace matrix; using matrix::Matrix;
using matrix::Matrix3f;
template class Matrix<float, 3, 3>; using matrix::Scalar;
using matrix::Vector;
using matrix::Vector2f;
int main() int main()
{ {
@ -24,7 +26,7 @@ int main()
Matrix3f m2(data); Matrix3f m2(data);
for(int i=0; i<9; i++) { 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] = { float data2d[3][3] = {
@ -34,7 +36,7 @@ int main()
}; };
m2 = Matrix3f(data2d); m2 = Matrix3f(data2d);
for(int i=0; i<9; i++) { 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}; float data_times_2[9] = {2, 4, 6, 8, 10, 12, 14, 16, 18};
@ -96,17 +98,17 @@ int main()
m4.swapCols(2, 2); m4.swapCols(2, 2);
TEST(isEqual(m4, Matrix3f(data))); TEST(isEqual(m4, Matrix3f(data)));
TEST(fabs(m4.min() - 1) < 1e-5); TEST(fabsf(m4.min() - 1) < 1e-5);
TEST(fabs((-m4).min() + 9) < 1e-5); TEST(fabsf((-m4).min() + 9) < 1e-5);
Scalar<float> s; Scalar<float> s;
s = 1; s = 1;
const Vector<float, 1> & s_vect = s; const Vector<float, 1> & s_vect = s;
TEST(fabs(s - 1) < 1e-5); TEST(fabsf(s - 1) < 1e-5);
TEST(fabs(s_vect(0) - 1.0f) < 1e-5); TEST(fabsf(s_vect(0) - 1.0f) < 1e-5);
Matrix<float, 1, 1> m5 = s; 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; Matrix<float, 2, 2> m6;
m6.setRow(0, Vector2f(1, 2)); m6.setRow(0, Vector2f(1, 2));

7
test/matrixMult.cpp

@ -1,9 +1,8 @@
#include <stdio.h>
#include <matrix/math.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/math.hpp>
using namespace matrix; using matrix::Matrix3f;
using matrix::eye;
int main() int main()
{ {

5
test/matrixScalarMult.cpp

@ -1,9 +1,8 @@
#include <stdio.h> #include "test_macros.hpp"
#include <matrix/math.hpp> #include <matrix/math.hpp>
#include "test_macros.hpp"
using namespace matrix; using matrix::Matrix3f;
int main() int main()
{ {

15
test/setIdentity.cpp

@ -1,9 +1,7 @@
#include <matrix/math.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/math.hpp>
using namespace matrix; using matrix::Matrix3f;
template class Matrix<float, 3, 3>;
int main() int main()
{ {
@ -13,10 +11,10 @@ int main()
for (size_t i = 0; i < 3; i++) { for (size_t i = 0; i < 3; i++) {
for (size_t j = 0; j < 3; j++) { for (size_t j = 0; j < 3; j++) {
if (i == j) { if (i == j) {
TEST( fabs(A(i, j) - 1) < 1e-7); TEST(fabsf(A(i, j) - 1) < 1e-7);
} else { } else {
TEST( fabs(A(i, j) - 0) < 1e-7); TEST(fabsf(A(i, j) - 0) < 1e-7);
} }
} }
} }
@ -27,13 +25,14 @@ int main()
for (size_t i = 0; i < 3; i++) { for (size_t i = 0; i < 3; i++) {
for (size_t j = 0; j < 3; j++) { for (size_t j = 0; j < 3; j++) {
if (i == j) { if (i == j) {
TEST( fabs(B(i, j) - 1) < 1e-7); TEST(fabsf(B(i, j) - 1) < 1e-7);
} else { } else {
TEST( fabs(B(i, j) - 0) < 1e-7); TEST(fabsf(B(i, j) - 0) < 1e-7);
} }
} }
} }
return 0; return 0;
} }

7
test/slice.cpp

@ -1,9 +1,8 @@
#include <stdio.h>
#include <matrix/math.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/math.hpp>
using namespace matrix; using matrix::Matrix;
using matrix::SquareMatrix;
int main() int main()
{ {

6
test/squareMatrix.cpp

@ -1,11 +1,9 @@
#include <stdio.h>
#include "test_macros.hpp" #include "test_macros.hpp"
#include <matrix/math.hpp> #include <matrix/math.hpp>
using namespace matrix; using matrix::SquareMatrix;
using matrix::Vector3;
template class SquareMatrix<float, 3>;
int main() int main()
{ {

9
test/transpose.cpp

@ -1,12 +1,8 @@
#include <stdio.h>
#include <matrix/math.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
using namespace matrix; #include <matrix/math.hpp>
template class Matrix<float, 2, 3>; using matrix::Matrix;
template class Matrix<float, 3, 2>;
int main() int main()
{ {
@ -16,6 +12,7 @@ int main()
float data_check[6] = {1, 4, 2, 5, 3, 6}; float data_check[6] = {1, 4, 2, 5, 3, 6};
Matrix<float, 3, 2> A_T_check(data_check); Matrix<float, 3, 2> A_T_check(data_check);
TEST(isEqual(A_T, A_T_check)); TEST(isEqual(A_T, A_T_check));
return 0; return 0;
} }

8
test/vector.cpp

@ -1,11 +1,9 @@
#include <stdio.h>
#include <matrix/math.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
using namespace matrix; #include <matrix/math.hpp>
template class Vector<float, 5>; using matrix::Vector;
using matrix::isEqualF;
int main() int main()
{ {

25
test/vector2.cpp

@ -1,35 +1,34 @@
#include <stdio.h>
#include <matrix/math.hpp> #include <matrix/math.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
using namespace matrix; using matrix::Vector2f;
using matrix::Matrix;
template class Vector<float, 2>;
int main() int main()
{ {
Vector2f a(1, 0); Vector2f a(1, 0);
Vector2f b(0, 1); Vector2f b(0, 1);
TEST(fabs(a % b - 1.0f) < 1e-5); TEST(fabsf(a % b - 1.0f) < 1e-5);
Vector2f c; Vector2f c;
TEST(fabs(c(0) - 0) < 1e-5); TEST(fabsf(c(0) - 0) < 1e-5);
TEST(fabs(c(1) - 0) < 1e-5); TEST(fabsf(c(1) - 0) < 1e-5);
Matrix<float, 2, 1> d(a); Matrix<float, 2, 1> d(a);
TEST(fabs(d(0,0) - 1) < 1e-5); TEST(fabsf(d(0,0) - 1) < 1e-5);
TEST(fabs(d(1,0) - 0) < 1e-5); TEST(fabsf(d(1,0) - 0) < 1e-5);
Vector2f e(d); Vector2f e(d);
TEST(fabs(e(0) - 1) < 1e-5); TEST(fabsf(e(0) - 1) < 1e-5);
TEST(fabs(e(1) - 0) < 1e-5); TEST(fabsf(e(1) - 0) < 1e-5);
float data[] = {4,5}; float data[] = {4,5};
Vector2f f(data); Vector2f f(data);
TEST(fabs(f(0) - 4) < 1e-5); TEST(fabsf(f(0) - 4) < 1e-5);
TEST(fabs(f(1) - 5) < 1e-5); TEST(fabsf(f(1) - 5) < 1e-5);
return 0; return 0;
} }

31
test/vector3.cpp

@ -1,34 +1,33 @@
#include <stdio.h>
#include <matrix/math.hpp>
#include "test_macros.hpp" #include "test_macros.hpp"
using namespace matrix; #include <matrix/math.hpp>
template class Vector<float, 3>; using matrix::Vector3f;
using matrix::Matrix;
int main() int main()
{ {
Vector3f a(1, 0, 0); Vector3f a(1, 0, 0);
Vector3f b(0, 1, 0); Vector3f b(0, 1, 0);
Vector3f c = a.cross(b); Vector3f c = a.cross(b);
TEST(isEqual(c, Vector3f(0,0,1))); TEST(matrix::isEqual(c, Vector3f(0,0,1)));
c = a % b; c = a % b;
TEST (isEqual(c, Vector3f(0,0,1))); TEST(matrix::isEqual(c, Vector3f(0,0,1)));
Matrix<float, 3, 1> d(c); Matrix<float, 3, 1> d(c);
Vector3f e(d); Vector3f e(d);
TEST (isEqual(e, d)); TEST (matrix::isEqual(e, d));
float data[] = {4, 5, 6}; float data[] = {4, 5, 6};
Vector3f f(data); Vector3f f(data);
TEST(isEqual(f, Vector3f(4, 5, 6))); TEST(matrix::isEqual(f, Vector3f(4, 5, 6)));
TEST(matrix::isEqual(a + b, Vector3f(1, 1, 0)));
TEST(matrix::isEqual(a - b, Vector3f(1, -1, 0)));
TEST(matrix::isEqualF(a * b, 0.0f));
TEST(matrix::isEqual(-a, Vector3f(-1, 0, 0)));
TEST(matrix::isEqual(a.unit(), a));
TEST(matrix::isEqual(a.unit(), a.normalized()));
TEST(matrix::isEqual(a*2.0, Vector3f(2, 0, 0)));
TEST(isEqual(a + b, Vector3f(1, 1, 0)));
TEST(isEqual(a - b, Vector3f(1, -1, 0)));
TEST(isEqualF(a * b, 0.0f));
TEST(isEqual(-a, Vector3f(-1, 0, 0)));
TEST(isEqual(a.unit(), a));
TEST(isEqual(a.unit(), a.normalized()));
TEST(isEqual(a*2.0, Vector3f(2, 0, 0)));
return 0; return 0;
} }

23
test/vectorAssignment.cpp

@ -2,9 +2,8 @@
#include "test_macros.hpp" #include "test_macros.hpp"
using namespace matrix; using matrix::SquareMatrix;
using matrix::Vector3f;
template class Vector<float, 3>;
int main() int main()
{ {
@ -15,20 +14,20 @@ int main()
static const float eps = 1e-7f; static const float eps = 1e-7f;
TEST(fabs(v(0) - 1) < eps); TEST(fabsf(v(0) - 1) < eps);
TEST(fabs(v(1) - 2) < eps); TEST(fabsf(v(1) - 2) < eps);
TEST(fabs(v(2) - 3) < eps); TEST(fabsf(v(2) - 3) < eps);
Vector3f v2(4, 5, 6); Vector3f v2(4, 5, 6);
TEST(fabs(v2(0) - 4) < eps); TEST(fabsf(v2(0) - 4) < eps);
TEST(fabs(v2(1) - 5) < eps); TEST(fabsf(v2(1) - 5) < eps);
TEST(fabs(v2(2) - 6) < eps); TEST(fabsf(v2(2) - 6) < eps);
SquareMatrix<float, 3> m = diag(Vector3f(1,2,3)); SquareMatrix<float, 3> m = diag(Vector3f(1,2,3));
TEST(fabs(m(0, 0) - 1) < eps); TEST(fabsf(m(0, 0) - 1) < eps);
TEST(fabs(m(1, 1) - 2) < eps); TEST(fabsf(m(1, 1) - 2) < eps);
TEST(fabs(m(2, 2) - 3) < eps); TEST(fabsf(m(2, 2) - 3) < eps);
return 0; return 0;
} }

Loading…
Cancel
Save