WSL/SLF GitLab Repository
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
snow-models
meteoio
Commits
99cd5da7
Commit
99cd5da7
authored
Jul 14, 2014
by
Mathias Bavay
Browse files
Fixed some errors and warnings when compiling the tests on Hera
parent
3c4f3dd3
Changes
3
Hide whitespace changes
Inline
Side-by-side
tests/arrays/arrays.cc
View file @
99cd5da7
...
...
@@ -143,7 +143,7 @@ bool grid3d(const unsigned int& n) {
return
status
;
}
bool
matrix
(
const
unsigned
in
t
&
n
)
{
bool
matrix
(
const
size_
t
&
n
)
{
cout
<<
"Testing Matrix
\n
"
;
bool
status
=
true
;
Matrix
I
(
n
,
1.
);
//build an n*n identity matrix
...
...
tests/dem_reading/dem_reading.cc
View file @
99cd5da7
...
...
@@ -114,33 +114,31 @@ bool makeDEMfiles(){
bool
compareFiles
(){
bool
status
=
true
;
for
(
int
i
=
0
;
i
<
n_files
;
i
++
){
for
(
int
i
=
0
;
i
<
n_files
;
i
++
)
{
// ------ Compare reference file with generated results ---------
cout
<<
" ---
Start c
omparing reference file with output file
generated before for :
"
<<
files
[
i
]
<<
endl
;
cout
<<
" ---
C
omparing reference file with
generated
output file "
<<
files
[
i
]
<<
endl
;
ifstream
ifref
((
prefix_ref
+
files
[
i
]).
c_str
());
ifstream
ifout
(
files
[
i
].
c_str
());
string
l_ref
,
l_out
;
while
(
!
ifref
.
eof
())
{
if
(
ifout
.
eof
()){
cerr
<<
"Not enough lines generated as result!!!"
<<
endl
;
while
(
!
ifref
.
eof
())
{
if
(
ifout
.
eof
())
{
cerr
<<
"Generated file has less lines than the reference!"
<<
endl
;
return
false
;
}
getline
(
ifref
,
l_ref
);
getline
(
ifout
,
l_out
);
if
(
l_ref
!=
l_out
)
{
cerr
<<
"
ERROR, Sun generatet error at following point an error
"
<<
endl
;
cerr
<<
"
Generated and reference files differ!
"
<<
endl
;
cerr
<<
"ref :
\n
"
<<
l_ref
<<
endl
;
cerr
<<
"out :
\n
"
<<
l_out
<<
endl
;
status
=
false
;
}
}
if
(
!
ifout
.
eof
()){
cerr
<<
"
To much lines generated as result!!
!"
<<
endl
;
if
(
!
ifout
.
eof
())
{
cerr
<<
"
Generated file has more lines than the reference
!"
<<
endl
;
status
=
false
;
}
ifout
.
close
();
...
...
@@ -152,11 +150,11 @@ bool compareFiles(){
int
main
(
void
)
{
if
(
!
makeDEMfiles
()){
if
(
!
makeDEMfiles
())
{
exit
(
1
);
}
if
(
!
compareFiles
()){
if
(
!
compareFiles
())
{
exit
(
1
);
}
...
...
tests/stats/stats.cc
View file @
99cd5da7
...
...
@@ -25,7 +25,7 @@ void cr_fixed_vectors(vector<double> &X, vector<double> &Y) {
void
cr_rand_vectors
(
vector
<
double
>
&
X
,
vector
<
double
>
&
Y
)
{
const
size_t
N
=
20
;
srand
(
time
(
NULL
)
);
srand
(
static_cast
<
unsigned
int
>
(
time
(
NULL
)
)
);
X
.
clear
();
X
.
resize
(
N
);
Y
.
clear
();
Y
.
resize
(
N
);
...
...
@@ -191,7 +191,7 @@ bool check_basics(const vector<double>& X, const vector<double>& Y) {
}
//vector weighted mean
const
vector
<
double
>
weights
(
X
.
size
(),
1.
/
(
X
.
size
()));
const
vector
<
double
>
weights
(
X
.
size
(),
1.
/
static_cast
<
double
>
(
X
.
size
()));
const
double
vector_mean
=
Interpol1D
::
weightedMean
(
X
,
weights
);
const
double
mean
=
Interpol1D
::
arithmeticMean
(
X
);
const
double
vector_mean_status
=
IOUtils
::
checkEpsilonEquality
(
vector_mean
,
mean
,
1e-6
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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