Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITABase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
ITABase
Commits
5f0ab1ab
Commit
5f0ab1ab
authored
Nov 29, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Plain Diff
Merging
parents
c184deaf
3bfe86ec
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
13 deletions
+57
-13
include/ITAConfigUtils.h
include/ITAConfigUtils.h
+1
-1
include/ITANumericUtils.h
include/ITANumericUtils.h
+14
-2
src/ITAStringUtilsPCRE.cpp
src/ITAStringUtilsPCRE.cpp
+15
-9
tests/CMakeLists.txt
tests/CMakeLists.txt
+9
-0
tests/ITAStringUtilsTest.cpp
tests/ITAStringUtilsTest.cpp
+15
-0
tests/VistaTests/CMakeLists.txt
tests/VistaTests/CMakeLists.txt
+3
-1
No files found.
include/ITAConfigUtils.h
View file @
5f0ab1ab
...
...
@@ -116,7 +116,7 @@ ITA_BASE_API void INIFileRequireNonemptyKey(const std::string& sINIFilename,
* | Diese Funktionen lsen Ausnahmen aus falls: |
* | |
* | - die INI-Datei nicht existiert |
* | - der Wert nicht als gewnschter Datentyp interpretierbar ist. |
|
* | - der Wert nicht als gewnschter Datentyp interpretierbar ist. |
* | |
* +----------------------------------------------------------------------------------------------+ */
...
...
include/ITANumericUtils.h
View file @
5f0ab1ab
...
...
@@ -429,6 +429,12 @@ template< typename T > inline void linspace( std::vector< T >& dest, T a, T b, T
// (Note a and b must be powers of two, otherwise an exception is thrown)
ITA_BASE_API
void
pow2space
(
std
::
vector
<
int
>&
dest
,
const
int
a
,
const
int
b
);
// returns the elevation angle (0 = frontal direction) in radians from a polar angle theta (0 = above)
ITA_BASE_API
double
theta2elevation
(
const
double
dThetaRAD
);
// returns the polar angle theta (0 = above) in radians from a given elevation angle (0 = frontal direction)
ITA_BASE_API
double
elevation2theta
(
const
double
dElevationRAD
);
// Calculates the factorial of an positive integer m
ITA_BASE_API
int
factorial
(
const
int
m
);
...
...
@@ -438,11 +444,17 @@ ITA_BASE_API double SHNormalizeConst( const int m, const int n );
//Calculates the Kronecker delta
ITA_BASE_API
int
SHKronecker
(
const
int
m
);
// Returns the
index of a basefunction with degree m and order n
// Returns the
linear index of a basefunction with degree m and order n, linear indexing starts with 0
ITA_BASE_API
int
SHDegreeOrder2Linear
(
const
int
m
,
const
int
n
);
// Returns degree and order of a basefunctions from a linear index, linear indexing starts with 0
ITA_BASE_API
void
SHLinear2DegreeOrder
(
const
int
iLinear
,
int
&
m
,
int
&
n
);
// Calculates the remax weightings up to a given order
ITA_BASE_API
std
::
vector
<
double
>
HOARemaxWeights
(
int
iTruncationOrder
);
//Calculates the realvalued Basefunctions of SH for e.g. Ambisonics
ITA_BASE_API
std
::
vector
<
double
>
SHRealvaluedBasefunctions
(
const
double
elevation
,
const
double
azimuth
,
const
int
maxOrder
);
ITA_BASE_API
std
::
vector
<
double
>
SHRealvaluedBasefunctions
(
const
double
thetaRAD
,
const
double
azimuthRAD
,
const
int
maxOrder
);
//Calculates the associated legendre polynomials
ITA_BASE_API
std
::
vector
<
double
>
SHAssociatedLegendre
(
const
int
N
,
const
double
mu
);
...
...
src/ITAStringUtilsPCRE.cpp
View file @
5f0ab1ab
...
...
@@ -385,11 +385,10 @@ std::vector< std::string > splitString( const std::string& s, const std::string&
return
splitString
(
s
,
char
(
sSeparator
[
0
]
)
);
else
ITA_EXCEPT0
(
NOT_IMPLEMENTED
);
// TODO: Implement for strings
return
v
;
}
void
regexSplitString
(
const
std
::
string
&
src
,
std
::
vector
<
std
::
string
>&
dest
,
const
std
::
string
&
regex
,
bool
bMatchCase
)
{
void
regexSplitString
(
const
std
::
string
&
src
,
std
::
vector
<
std
::
string
>&
dest
,
const
std
::
string
&
regex
,
bool
bMatchCase
)
{
dest
.
clear
();
if
(
src
.
empty
()
)
return
;
...
...
@@ -587,7 +586,8 @@ bool ITAConversion::StringToDouble( const std::string& s, double& d ) {
return
bValid
;
}
bool
ITAConversion
::
StringToIntVec
(
const
std
::
string
&
s
,
std
::
vector
<
int
>&
v
,
std
::
string
sSeparatorRegex
,
bool
bMatchCase
)
{
bool
ITAConversion
::
StringToIntVec
(
const
std
::
string
&
s
,
std
::
vector
<
int
>&
v
,
std
::
string
sSeparatorRegex
,
bool
bMatchCase
)
{
// [fwe 2008-07-09] TODO: Diese Implementierung ist mal eben gebaut und hemdsärmelig! Verbessern!
pcrecpp
::
RE_Options
re_opts
;
re_opts
.
set_multiline
(
true
);
...
...
@@ -598,19 +598,23 @@ bool ITAConversion::StringToIntVec( const std::string& s, std::vector<int>& v, s
std
::
string
part
;
v
.
clear
();
while
(
re
.
FindAndConsume
(
&
input
,
&
part
)
)
{
while
(
re
.
FindAndConsume
(
&
input
,
&
part
)
)
{
int
i
;
if
(
!
StringToInt
(
part
,
i
)
)
{
if
(
!
StringToInt
(
part
,
i
)
)
{
v
.
clear
();
return
false
;
}
v
.
push_back
(
i
);
}
std
::
string
e
=
re
.
error
();
return
true
;
}
bool
ITAConversion
::
StringToUIntVec
(
const
std
::
string
&
s
,
std
::
vector
<
unsigned
int
>&
v
,
std
::
string
sSeparatorRegex
,
bool
bMatchCase
)
{
bool
ITAConversion
::
StringToUIntVec
(
const
std
::
string
&
s
,
std
::
vector
<
unsigned
int
>&
v
,
std
::
string
sSeparatorRegex
,
bool
bMatchCase
)
{
// [fwe 2008-07-09] TODO: Diese Implementierung ist mal eben gebaut und hemdsärmelig! Verbessern!
pcrecpp
::
RE_Options
re_opts
;
re_opts
.
set_multiline
(
true
);
...
...
@@ -621,9 +625,11 @@ bool ITAConversion::StringToUIntVec( const std::string& s, std::vector<unsigned
std
::
string
part
;
v
.
clear
();
while
(
re
.
FindAndConsume
(
&
input
,
&
part
)
)
{
while
(
re
.
FindAndConsume
(
&
input
,
&
part
)
)
{
unsigned
int
i
;
if
(
!
StringToUInt
(
part
,
i
)
)
{
if
(
!
StringToUInt
(
part
,
i
)
)
{
v
.
clear
();
return
false
;
}
...
...
tests/CMakeLists.txt
View file @
5f0ab1ab
...
...
@@ -7,6 +7,15 @@ include( VistaCommon )
vista_use_package
(
ITABase REQUIRED FIND_DEPENDENCIES
)
add_executable
(
ITAStringUtilsTest ITAStringUtilsTest.cpp
)
target_link_libraries
(
ITAStringUtilsTest
${
VISTA_USE_PACKAGE_LIBRARIES
}
)
vista_configure_app
(
ITAStringUtilsTest
)
vista_install
(
ITAStringUtilsTest
)
vista_create_default_info_file
(
ITAStringUtilsTest
)
set_property
(
TARGET ITAStringUtilsTest PROPERTY FOLDER
"ITACoreLibs/Tests/ITABase"
)
add_executable
(
ITABaseSampleBufferTest ITABaseSampleBufferTest.cpp
)
target_link_libraries
(
ITABaseSampleBufferTest
${
VISTA_USE_PACKAGE_LIBRARIES
}
)
...
...
tests/ITAStringUtilsTest.cpp
0 → 100644
View file @
5f0ab1ab
#include <ITAStringUtils.h>
#include <iostream>
using
namespace
std
;
int
main
(
int
,
char
**
)
{
std
::
vector
<
int
>
v
=
StringToIntVec
(
"1,2,3,4"
);
for
(
int
n
:
v
)
cout
<<
n
<<
endl
;
return
0
;
}
tests/VistaTests/CMakeLists.txt
View file @
5f0ab1ab
...
...
@@ -4,9 +4,11 @@ project( VistaTests )
list
(
APPEND CMAKE_MODULE_PATH
"$ENV{VISTA_CMAKE_COMMON}"
)
include
(
VistaCommon
)
vista_use_package
(
VistaCoreLibs REQUIRED COMPONENTS VistaInterProcComm FIND_DEPENDENCIES
)
if
(
WIN32 AND ITA_VISTA_BUILD_STATIC
)
list
(
APPEND VISTA_USE_PACKAGE_LIBRARIES Ws2_32 Winmm
)
endif
(
)
add_executable
(
VistaTickerTest VistaTickerTest.cpp
)
target_link_libraries
(
VistaTickerTest
${
VISTA_USE_PACKAGE_LIBRARIES
}
)
...
...
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