Hello community,

here is the log from the commit of package armadillo for openSUSE:Factory 
checked in at 2015-06-24 21:03:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/armadillo (Old)
 and      /work/SRC/openSUSE:Factory/.armadillo.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "armadillo"

Changes:
--------
--- /work/SRC/openSUSE:Factory/armadillo/armadillo.changes      2015-05-27 
12:52:27.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.armadillo.new/armadillo.changes 2015-06-24 
21:03:51.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Jun 24 07:50:21 UTC 2015 - badshah...@gmail.com
+
+- Update to version 5.200.2:
+  + Bugfix in interp1().
+
+-------------------------------------------------------------------

Old:
----
  armadillo-5.200.1.tar.gz

New:
----
  armadillo-5.200.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ armadillo.spec ++++++
--- /var/tmp/diff_new_pack.NDNQJt/_old  2015-06-24 21:03:52.000000000 +0200
+++ /var/tmp/diff_new_pack.NDNQJt/_new  2015-06-24 21:03:52.000000000 +0200
@@ -19,7 +19,7 @@
 %define soname libarmadillo5
 
 Name:           armadillo
-Version:        5.200.1
+Version:        5.200.2
 Release:        0
 Summary:        Fast C++ matrix library with interfaces to LAPACK and ATLAS
 License:        MPL-2.0

++++++ armadillo-5.200.1.tar.gz -> armadillo-5.200.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/armadillo-5.200.1/CMakeLists.txt 
new/armadillo-5.200.2/CMakeLists.txt
--- old/armadillo-5.200.1/CMakeLists.txt        2015-05-24 05:52:32.000000000 
+0200
+++ new/armadillo-5.200.2/CMakeLists.txt        2015-06-22 00:54:21.000000000 
+0200
@@ -14,7 +14,7 @@
 
 set(ARMA_MAJOR 5)
 set(ARMA_MINOR 200)
-set(ARMA_PATCH 1)
+set(ARMA_PATCH 2)
 set(ARMADILLO_VERSION ${ARMA_MAJOR}.${ARMA_MINOR}.${ARMA_PATCH})
 
 message(STATUS "Configuring Armadillo ${ARMADILLO_VERSION}")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/armadillo-5.200.1/README.txt 
new/armadillo-5.200.2/README.txt
--- old/armadillo-5.200.1/README.txt    2015-05-24 05:52:32.000000000 +0200
+++ new/armadillo-5.200.2/README.txt    2015-06-22 00:54:21.000000000 +0200
@@ -192,7 +192,7 @@
 If you want to use Armadillo without installation,
 or you're getting linking errors, compile along these lines:
   
-  g++ example1.cpp -o example1 -O2 -I /home/blah/armadillo-5.200.1/include 
-DARMA_DONT_USE_WRAPPER -lblas -llapack
+  g++ example1.cpp -o example1 -O2 -I /home/blah/armadillo-5.200.2/include 
-DARMA_DONT_USE_WRAPPER -lblas -llapack
   
 The above command line assumes that you have unpacked the armadillo archive 
into /home/blah/
 You will need to adjust this for later versions of Armadillo,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/armadillo-5.200.1/include/armadillo_bits/arma_version.hpp 
new/armadillo-5.200.2/include/armadillo_bits/arma_version.hpp
--- old/armadillo-5.200.1/include/armadillo_bits/arma_version.hpp       
2015-05-24 05:52:32.000000000 +0200
+++ new/armadillo-5.200.2/include/armadillo_bits/arma_version.hpp       
2015-06-22 00:54:21.000000000 +0200
@@ -13,7 +13,7 @@
 
 #define ARMA_VERSION_MAJOR 5
 #define ARMA_VERSION_MINOR 200
-#define ARMA_VERSION_PATCH 1
+#define ARMA_VERSION_PATCH 2
 #define ARMA_VERSION_NAME  "Boston Tea Smuggler"
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/armadillo-5.200.1/include/armadillo_bits/fn_interp1.hpp 
new/armadillo-5.200.2/include/armadillo_bits/fn_interp1.hpp
--- old/armadillo-5.200.1/include/armadillo_bits/fn_interp1.hpp 2015-04-25 
05:33:44.000000000 +0200
+++ new/armadillo-5.200.2/include/armadillo_bits/fn_interp1.hpp 2015-06-22 
00:41:09.000000000 +0200
@@ -92,9 +92,6 @@
   
   for(uword i=0; i<NI; ++i)
     {
-    eT a_best_err = Datum<eT>::inf;
-    eT b_best_err = Datum<eT>::inf;
-    
     const eT XI_val = XI_mem[i];
     
     arma_debug_check( ((XI_val < XG_min) || (XI_val > XG_max)), "interp1(): 
extrapolation not supported" );
@@ -102,6 +99,9 @@
     // XG and XI are guaranteed to be sorted in ascending manner,
     // so start searching XG from last known optimum position 
     
+    eT a_best_err = Datum<eT>::inf;
+    eT b_best_err = Datum<eT>::inf;
+    
     for(uword j=a_best_j; j<NG; ++j)
       {
       const eT tmp = XG_mem[j] - XI_val;
@@ -109,31 +109,37 @@
       
       if(err >= a_best_err)
         {
-        if(err < b_best_err)
-          {
-          b_best_err = err;
-          b_best_j   = j;
-          }
-        
         break;
         }
       else
         {
-        b_best_err = a_best_err;
-        b_best_j   = a_best_j;
-        
         a_best_err = err;
         a_best_j   = j;
         }
       }
     
+    if( (XG_mem[a_best_j] - XI_val) <= eT(0) )
+      {
+      // a_best_j is to the left of the interpolated position
+      
+      b_best_j = ( (a_best_j+1) < NG) ? (a_best_j+1) : a_best_j; 
+      }
+    else
+      {
+      // a_best_j is to the right of the interpolated position
+      
+      b_best_j = (a_best_j >= 1) ? (a_best_j-1) : a_best_j; 
+      }
+    
+    b_best_err = std::abs( XG_mem[b_best_j] - XI_val );
+    
     if(a_best_j > b_best_j)
       {
       std::swap(a_best_j,   b_best_j  );
       std::swap(a_best_err, b_best_err);
       }
     
-    const eT weight = a_best_err / (a_best_err + b_best_err);
+    const eT weight = (a_best_err > eT(0)) ? (a_best_err / (a_best_err + 
b_best_err)) : eT(0);
     
     YI_mem[i] = (eT(1) - weight)*YG_mem[a_best_j] + (weight)*YG_mem[b_best_j];
     }


Reply via email to