Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Institute of Technical Acoustics (ITA)
ITABase
Commits
97e1897e
Commit
97e1897e
authored
Jun 21, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving log limits to ITAConstants
parent
b3ec5f9c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
include/ITAConstants.h
include/ITAConstants.h
+8
-1
include/ITAThirdOctaveMagnitudeSpectrum.h
include/ITAThirdOctaveMagnitudeSpectrum.h
+3
-5
No files found.
include/ITAConstants.h
View file @
97e1897e
...
@@ -24,7 +24,8 @@
...
@@ -24,7 +24,8 @@
// STL
// STL
#include <cmath>
#include <cmath>
#include <climits>
#include <numeric>
#include <limits>
namespace
ITAConstants
namespace
ITAConstants
{
{
...
@@ -51,6 +52,12 @@ namespace ITAConstants
...
@@ -51,6 +52,12 @@ namespace ITAConstants
// Epsilon (distance quantization)
// Epsilon (distance quantization)
static
float
EPS_F_L
=
1.0e-5
f
;
// 10 micro meter
static
float
EPS_F_L
=
1.0e-5
f
;
// 10 micro meter
static
double
EPS_D_L
=
1.0e-5
f
;
// 10 micro meter
static
double
EPS_D_L
=
1.0e-5
f
;
// 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
#endif // INCLUDE_WATCHER_ITA_CONSTANTS
include/ITAThirdOctaveMagnitudeSpectrum.h
View file @
97e1897e
...
@@ -21,9 +21,7 @@
...
@@ -21,9 +21,7 @@
#include <ITABaseDefinitions.h>
#include <ITABaseDefinitions.h>
#include <ITAMagnitudeSpectrum.h>
#include <ITAMagnitudeSpectrum.h>
#include <ITAConstants.h>
#include <numeric>
#include <limits>
//! Third octave magnitude spectrum
//! Third octave magnitude spectrum
/**
/**
...
@@ -149,7 +147,7 @@ public:
...
@@ -149,7 +147,7 @@ public:
inline
void
SetZero
()
inline
void
SetZero
()
{
{
for
(
size_t
n
=
0
;
n
<
m_vfValues
.
size
();
n
++
)
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
inline
bool
IsIdentity
()
const
...
@@ -167,7 +165,7 @@ public:
...
@@ -167,7 +165,7 @@ public:
{
{
for
(
size_t
n
=
0
;
n
<
m_vfValues
.
size
();
n
++
)
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
;
return
false
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment