Commit 97e1897e authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Moving log limits to ITAConstants

parent b3ec5f9c
......@@ -24,7 +24,8 @@
// STL
#include <cmath>
#include <climits>
#include <numeric>
#include <limits>
namespace ITAConstants
{
......@@ -51,6 +52,12 @@ namespace ITAConstants
// Epsilon (distance quantization)
static float EPS_F_L = 1.0e-5f; // 10 micro meter
static double EPS_D_L = 1.0e-5f; // 10 micro meter
// Log-scale limits
static float INFINITY_F = std::numeric_limits< float >::infinity();
static float MINUS_INFINITY_F = -std::numeric_limits< float >::infinity();
static float INFINITY_D = std::numeric_limits< double >::infinity();
static float MINUS_INFINITY_D = -std::numeric_limits< double >::infinity();
};
#endif // INCLUDE_WATCHER_ITA_CONSTANTS
......@@ -21,9 +21,7 @@
#include <ITABaseDefinitions.h>
#include <ITAMagnitudeSpectrum.h>
#include <numeric>
#include <limits>
#include <ITAConstants.h>
//! Third octave magnitude spectrum
/**
......@@ -149,7 +147,7 @@ public:
inline void SetZero()
{
for( size_t n = 0; n < m_vfValues.size(); n++ )
m_vfValues[ n ] = -std::numeric_limits< float >::infinity();
m_vfValues[ n ] = ITAConstants::MINUS_INFINITY_F;
};
inline bool IsIdentity() const
......@@ -167,7 +165,7 @@ public:
{
for( size_t n = 0; n < m_vfValues.size(); n++ )
{
if( m_vfValues[ n ] != -std::numeric_limits< float >::infinity() )
if( m_vfValues[ n ] != ITAConstants::MINUS_INFINITY_F )
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment