[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/09: volk: fixup QA's fcompare to test al
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/09: volk: fixup QA's fcompare to test all differences |
Date: |
Tue, 28 Jan 2014 20:10:55 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 01bd2af9635808c52bc9378ef82acb6df6ce0f6f
Author: Nathan West <address@hidden>
Date: Mon Jan 27 14:58:30 2014 -0600
volk: fixup QA's fcompare to test all differences
This addresses bug 627 by adding a fabs call when checking if a number
is close to 0. If this is the case we also make sure the other buffer
is within tolerance. For the normal test case wrap the percent difference
in fabs rather than just the difference.
---
volk/lib/qa_utils.cc | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/volk/lib/qa_utils.cc b/volk/lib/qa_utils.cc
index 9bf4b71..d5d2d7c 100644
--- a/volk/lib/qa_utils.cc
+++ b/volk/lib/qa_utils.cc
@@ -231,8 +231,19 @@ bool fcompare(t *in1, t *in2, unsigned int vlen, float
tol) {
bool fail = false;
int print_max_errs = 10;
for(unsigned int i=0; i<vlen; i++) {
- if(((t *)(in1))[i] < 1e-30) continue; //this is a hack: below around
here we'll start to get roundoff errors due to limited precision
- if(fabs(((t *)(in1))[i] - ((t *)(in2))[i])/(((t *)in1)[i]) > tol) {
+ // for very small numbers we'll see round off errors due to limited
+ // precision. So a special test case...
+ if(fabs(((t *)(in1))[i]) < 1e-30) {
+ if( fabs( ((t *)(in2))[i] ) > tol )
+ {
+ fail=true;
+ if(print_max_errs-- > 0) {
+ std::cout << "offset " << i << " in1: " << t(((t
*)(in1))[i]) << " in2: " << t(((t *)(in2))[i]) << std::endl;
+ }
+ }
+ }
+ // the primary test is the percent different greater than given tol
+ else if(fabs(((t *)(in1))[i] - ((t *)(in2))[i])/(((t *)in1)[i]) > tol)
{
fail=true;
if(print_max_errs-- > 0) {
std::cout << "offset " << i << " in1: " << t(((t *)(in1))[i])
<< " in2: " << t(((t *)(in2))[i]) << std::endl;
- [Commit-gnuradio] [gnuradio] branch maint updated (30c7c0e -> eac6823), git, 2014/01/28
- [Commit-gnuradio] [gnuradio] 03/09: volk/qa: For complex series, check the EVM rather than real/imag separately, git, 2014/01/28
- [Commit-gnuradio] [gnuradio] 09/09: volk/rotator: Use more precise phase_inc in volk_profile, git, 2014/01/28
- [Commit-gnuradio] [gnuradio] 05/09: volk/rotator: Fix the volk_32fc_s32fc_x2_rotator_32fc_generic kernel, git, 2014/01/28
- [Commit-gnuradio] [gnuradio] 07/09: volk/rotator: Tighten the tolerance to 1e-3 in QA, git, 2014/01/28
- [Commit-gnuradio] [gnuradio] 08/09: volk/rotator: Fix some debug printf accessing array out-of-bound, git, 2014/01/28
- [Commit-gnuradio] [gnuradio] 06/09: volk/rotator: Fix the renormalization process (missing sqrt), git, 2014/01/28
- [Commit-gnuradio] [gnuradio] 01/09: volk: proposed solutions to bugs 582/583, git, 2014/01/28
- [Commit-gnuradio] [gnuradio] 02/09: volk: fixup QA's fcompare to test all differences,
git <=
- [Commit-gnuradio] [gnuradio] 04/09: volk: enabling unaligned protokernels for rotator, git, 2014/01/28