mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix annoying warnings
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
EIGEN_DISABLE_DEPRECATED_WARNING
|
||||
|
||||
#include <unsupported/Eigen/EulerAngles>
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
@@ -54,7 +54,7 @@ void test_nnls_known_solution(const MatrixType &A, const VectorB &b, const Vecto
|
||||
}
|
||||
|
||||
template <typename MatrixType>
|
||||
void test_nnls_random_problem() {
|
||||
void test_nnls_random_problem(const MatrixType&) {
|
||||
//
|
||||
// SETUP
|
||||
//
|
||||
@@ -448,12 +448,9 @@ EIGEN_DECLARE_TEST(NNLS) {
|
||||
|
||||
for (int i = 0; i < g_repeat; i++) {
|
||||
// Essential NNLS properties, across different types.
|
||||
CALL_SUBTEST_2(test_nnls_random_problem<MatrixXf>());
|
||||
CALL_SUBTEST_3(test_nnls_random_problem<MatrixXd>());
|
||||
{
|
||||
using MatFixed = Matrix<double, 12, 5>;
|
||||
CALL_SUBTEST_4(test_nnls_random_problem<MatFixed>());
|
||||
}
|
||||
CALL_SUBTEST_2(test_nnls_random_problem(MatrixXf()));
|
||||
CALL_SUBTEST_3(test_nnls_random_problem(MatrixXd()));
|
||||
CALL_SUBTEST_4(test_nnls_random_problem(Matrix<double, 12, 5>()));
|
||||
CALL_SUBTEST_5(test_nnls_with_half_precision());
|
||||
|
||||
// Robustness tests:
|
||||
|
||||
@@ -30,7 +30,7 @@ static void test_type_cast() {
|
||||
|
||||
for (int i = 0; i < 101; ++i) {
|
||||
for (int j = 0; j < 201; ++j) {
|
||||
const ToType ref = static_cast<ToType>(ftensor(i, j));
|
||||
const ToType ref = internal::cast<FromType, ToType>(ftensor(i, j));
|
||||
VERIFY_IS_EQUAL(ttensor(i, j), ref);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ void test_sum_accuracy() {
|
||||
// Test against probabilistic forward error bound. In reality, the error is much smaller
|
||||
// when we use tree summation.
|
||||
double err = Eigen::numext::abs(static_cast<double>(sum()) - expected_sum);
|
||||
double tol = numext::sqrt(static_cast<double>(num_elements)) * NumTraits<ScalarType>::epsilon() * static_cast<ScalarType>(abs_sum);
|
||||
double tol = numext::sqrt(static_cast<double>(num_elements)) * static_cast<double>(NumTraits<ScalarType>::epsilon()) * abs_sum;
|
||||
VERIFY_LE(err, tol);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user