[vspline] 71/72: removed use of a vla in prefilter.h

Kay F. Jahnke kfj-guest at moszumanska.debian.org
Sun Jul 2 09:02:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

kfj-guest pushed a commit to branch master
in repository vspline.

commit 48e31caae4c195ff7c9cda1eabe01c84e15a5bb8
Author: Kay F. Jahnke <kfjahnke at gmail.com>
Date:   Thu Jun 22 15:38:50 2017 +0200

    removed use of a vla in prefilter.h
---
 filter.h      | 3 ++-
 multithread.h | 7 ++++---
 prefilter.h   | 5 ++++-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/filter.h b/filter.h
index 9f56e8e..f85064b 100644
--- a/filter.h
+++ b/filter.h
@@ -819,7 +819,8 @@ void scatter ( const source_type* source ,
 template < class source_view_type ,
            class target_view_type ,
            class math_type >
-void nonaggregating_filter ( range_type < typename source_view_type::difference_type > range ,
+void nonaggregating_filter ( vspline::range_type
+                              < typename source_view_type::difference_type > range ,
                              source_view_type * p_original_source ,
                              target_view_type * p_original_target ,
                              int axis ,
diff --git a/multithread.h b/multithread.h
index 8967446..a9e44f1 100644
--- a/multithread.h
+++ b/multithread.h
@@ -146,11 +146,12 @@ using range_type = vigra::TinyVector < limit_type , 2 > ;
 template < class range_type >
 using partition_type = std::vector < range_type > ;
 
-/// given a dimension, we define a shape_type as a TinyVector of long
-/// of this dimension. This is equivalent to vigra's shape type.
+/// given a dimension, we define a shape_type as a TinyVector of
+/// vigra::MultiArrayIndex of this dimension.
+/// This is equivalent to vigra's shape type.
 
 template < int dimension >
-using shape_type = vigra::TinyVector < long , dimension > ;
+using shape_type = vigra::TinyVector <  vigra::MultiArrayIndex , dimension > ;
 
 /// given a dimension, we define shape_range_type as a range defined by
 /// two shapes of the given dimension. This definition allows us to directly
diff --git a/prefilter.h b/prefilter.h
index ae49859..96272b9 100644
--- a/prefilter.h
+++ b/prefilter.h
@@ -175,10 +175,11 @@ void solve ( input_array_type & input ,
   {
     assert ( smoothing > 0.0 && smoothing < 1.0 ) ;
     int npoles = degree / 2 + 1 ;
-    double pole [ npoles ] ;
+    double *pole = new double [ npoles ] ;
     pole[0] = smoothing ;
     for ( int i = 1 ; i < npoles ; i++ )
       pole[i] = vspline_constants::precomputed_poles [ degree ] [ i - 1 ] ;
+    
     filter_nd < input_array_type , output_array_type , math_type >
               ( input ,
                 output ,
@@ -187,6 +188,8 @@ void solve ( input_array_type & input ,
                 pole ,
                 tolerance ,
                 njobs ) ;
+                
+    delete[] pole ;
   }
   else
     filter_nd < input_array_type , output_array_type , math_type >

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/vspline.git



More information about the debian-science-commits mailing list