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:
@@ -998,8 +998,8 @@ class StridedLinearBufferCopy {
|
||||
enum {
|
||||
Vectorizable = packet_traits<Scalar>::Vectorizable,
|
||||
PacketSize = packet_traits<Scalar>::size,
|
||||
HasHalfPacket = unpacket_traits<HalfPacket>::size < PacketSize,
|
||||
HalfPacketSize = unpacket_traits<HalfPacket>::size,
|
||||
HasHalfPacket = static_cast<int>(HalfPacketSize) < static_cast<int>(PacketSize)
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
@@ -181,15 +181,16 @@ class FFT
|
||||
typedef typename impl_type::Scalar Scalar;
|
||||
typedef typename impl_type::Complex Complex;
|
||||
|
||||
enum Flag {
|
||||
Default=0, // goof proof
|
||||
Unscaled=1,
|
||||
HalfSpectrum=2,
|
||||
// SomeOtherSpeedOptimization=4
|
||||
Speedy=32767
|
||||
};
|
||||
using Flag = int;
|
||||
static constexpr Flag Default = 0;
|
||||
static constexpr Flag Unscaled = 1;
|
||||
static constexpr Flag HalfSpectrum = 2;
|
||||
static constexpr Flag Speedy = 32767;
|
||||
|
||||
FFT( const impl_type & impl=impl_type() , Flag flags=Default ) :m_impl(impl),m_flag(flags) { }
|
||||
FFT( const impl_type & impl=impl_type() , Flag flags=Default ) :m_impl(impl),m_flag(flags)
|
||||
{
|
||||
eigen_assert((flags == Default || flags == Unscaled || flags == HalfSpectrum || flags == Speedy) && "invalid flags argument");
|
||||
}
|
||||
|
||||
inline
|
||||
bool HasFlag(Flag f) const { return (m_flag & (int)f) == f;}
|
||||
|
||||
@@ -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