[med-svn] r19242 - in trunk/packages/plastimatch/trunk/debian: . patches
Greg Sharp
gregsharp-guest at moszumanska.debian.org
Fri May 15 19:13:24 UTC 2015
Author: gregsharp-guest
Date: 2015-05-15 19:13:23 +0000 (Fri, 15 May 2015)
New Revision: 19242
Added:
trunk/packages/plastimatch/trunk/debian/patches/
trunk/packages/plastimatch/trunk/debian/patches/fix-regression-plm-reg-align-center
trunk/packages/plastimatch/trunk/debian/patches/series
Modified:
trunk/packages/plastimatch/trunk/debian/changelog
Log:
Fix plastimatch failing regression test on i386
Modified: trunk/packages/plastimatch/trunk/debian/changelog
===================================================================
--- trunk/packages/plastimatch/trunk/debian/changelog 2015-05-15 18:36:15 UTC (rev 19241)
+++ trunk/packages/plastimatch/trunk/debian/changelog 2015-05-15 19:13:23 UTC (rev 19242)
@@ -1,3 +1,10 @@
+plastimatch (1.6.1+dfsg-2) UNRELEASED; urgency=medium
+
+ * debian/patches/fix-regression-plm-reg-align-center:
+ Fix regression test failure on i386
+
+ -- Gregory C. Sharp <gregsharp.geo at yahoo.com> Fri, 15 May 2015 11:34:18 -0400
+
plastimatch (1.6.1+dfsg-1) unstable; urgency=medium
[ Gregory C. Sharp ]
Added: trunk/packages/plastimatch/trunk/debian/patches/fix-regression-plm-reg-align-center
===================================================================
--- trunk/packages/plastimatch/trunk/debian/patches/fix-regression-plm-reg-align-center (rev 0)
+++ trunk/packages/plastimatch/trunk/debian/patches/fix-regression-plm-reg-align-center 2015-05-15 19:13:23 UTC (rev 19242)
@@ -0,0 +1,60 @@
+Description: Fix test error caused by floating point rounding issue
+Author: Greg Sharp <gregsharp.geo at yahoo.com>
+
+--- a/src/plastimatch/base/plm_image_header.cxx
++++ b/src/plastimatch/base/plm_image_header.cxx
+@@ -433,24 +433,25 @@
+ }
+ }
+
+-double
+-Plm_image_header::plm_round(double val, int digits)
+-{
+- return floor(val * pow((double)10, digits) + 0.5) / pow((double)10, digits);
+-}
+-
+-/* Return 1 if the two headers are the same. Added tolerance (5 digits) */
++/* Return true if the two headers are the same, within tolerance */
+ bool
+-Plm_image_header::compare (Plm_image_header *pli1, Plm_image_header *pli2,int digits)
++Plm_image_header::compare (Plm_image_header *pli1, Plm_image_header *pli2,
++ float threshold)
+ {
+ int d;
+ for (d = 0; d < 3; d++) {
+- if (plm_round(pli1->m_origin[d],5) != plm_round(pli2->m_origin[d],5)) return 0;
+- if (plm_round(pli1->m_spacing[d],5) != plm_round(pli2->m_spacing[d],5)) return 0;
+- if (plm_round(pli1->Size(d),5) != plm_round(pli2->Size(d),5)) return 0;
++ if (fabs (pli1->m_origin[d] - pli2->m_origin[d]) > threshold) {
++ return false;
++ }
++ if (fabs (pli1->m_spacing[d] - pli2->m_spacing[d]) > threshold) {
++ return false;
++ }
++ if (pli1->Size(d) != pli2->Size(d)) {
++ return false;
++ }
+ }
+
+ /* GCS FIX: check direction cosines */
+
+- return 1;
++ return true;
+ }
+--- a/src/plastimatch/base/plm_image_header.h
++++ b/src/plastimatch/base/plm_image_header.h
+@@ -69,9 +69,11 @@
+ int Size (int d) const { return m_region.GetSize()[d]; }
+ const SizeType& GetSize (void) const { return m_region.GetSize (); }
+ public:
+- /*! \brief Return true if the two headers are the same. Tolerance can be specified via using digits (=number of digits used for rounding values) */
+- static bool compare (Plm_image_header *pli1, Plm_image_header *pli2,int digits=5);
+- static double plm_round(double val, int digits);
++ /*! \brief Return true if the two headers are the same.
++ Tolerance on origin and spacing can be specified
++ using the threshold parameter */
++ static bool compare (Plm_image_header *pli1, Plm_image_header *pli2,
++ float threshold = 1e-5);
+
+ int dim (int d) const { return m_region.GetSize()[d]; }
+ float origin (int d) const { return m_origin[d]; }
Added: trunk/packages/plastimatch/trunk/debian/patches/series
===================================================================
--- trunk/packages/plastimatch/trunk/debian/patches/series (rev 0)
+++ trunk/packages/plastimatch/trunk/debian/patches/series 2015-05-15 19:13:23 UTC (rev 19242)
@@ -0,0 +1 @@
+fix-regression-plm-reg-align-center
More information about the debian-med-commit
mailing list