libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd/cvd convolution.h


From: Colin Starr
Subject: [libcvd-members] libcvd/cvd convolution.h
Date: Mon, 19 Mar 2007 15:39:25 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Colin Starr <ccs36>     07/03/19 15:39:25

Modified files:
        cvd            : convolution.h 

Log message:
        ISO C++ forbids variable-size arrays

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/convolution.h?cvsroot=libcvd&r1=1.6&r2=1.7

Patches:
Index: convolution.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/convolution.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- convolution.h       24 May 2006 13:55:21 -0000      1.6
+++ convolution.h       19 Mar 2007 15:39:24 -0000      1.7
@@ -429,7 +429,7 @@
   typedef typename Pixel::traits<T>::float_type sum_type;
   assert(out.size() == I.size());
   int ksize = (int)(sigmas*sigma + 0.5);
-  sum_comp_type kernel[ksize];
+  sum_comp_type *kernel = new sum_comp_type[ksize];
   sum_comp_type ksum = sum_comp_type();
   for (int i=1; i<=ksize; i++)
     ksum += (kernel[i-1] = 
static_cast<sum_comp_type>(exp(-i*i/(2*sigma*sigma))));
@@ -444,7 +444,7 @@
   sum_type* rowbuf = Internal::aligned_mem<sum_type,16>::alloc(w);
   sum_type* outbuf = Internal::aligned_mem<sum_type,16>::alloc(w);
 
-  sum_type* rows[swin+1];
+  sum_type** rows = new sum_type*[swin+1];
   for (int k=0;k<swin+1;k++)
     rows[k] = buffer + k*w;
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]