Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Jahns
PPM
Commits
332fd466
Commit
332fd466
authored
Mar 02, 2021
by
Thomas Jahns
🤸
Browse files
Add extra consistency check.
parent
9584e97f
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test_combinatorics_c.c
View file @
332fd466
...
...
@@ -90,6 +90,7 @@ main()
++
(
occCount
[
i
][
list
[
i
]]);
}
failures
=
0
;
size_t
occCountSum
=
0
;
for
(
size_t
j
=
0
;
j
<
n
;
++
j
)
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
{
...
...
@@ -98,6 +99,7 @@ main()
float
rel_delta
=
abs_delta
/
(
float
)
n
/
(
float
)
numRuns
;
if
(
rel_delta
>
0
.
01
f
)
++
failures
;
occCountSum
+=
occCount
[
j
][
i
];
}
if
(
failures
>
0
)
{
...
...
@@ -111,6 +113,12 @@ main()
fputs
(
"
\n
"
,
stdout
);
}
}
if
(
occCountSum
!=
n
*
numRuns
)
{
fprintf
(
stderr
,
"n*numRuns=%zu, occCountSum=%zu
\n
"
,
n
*
numRuns
,
occCountSum
);
exit
(
EXIT_FAILURE
);
}
}
free
(
list
);
free
(
occCount
);
...
...
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