Add vlen to subtract, divide, and float2complex.
[debian/gnuradio] / gnuradio-core / src / lib / gengen / gr_divide_XX.cc.t
index fbffc2d5984704ced4756053568214b957261d5c..9fc6d34e919b4f91ea7f2c84444a547de0867baa 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004, 2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
 #include <gr_io_signature.h>
 
 @SPTR_NAME@
-gr_make_@BASE_NAME@ ()
+gr_make_@BASE_NAME@ (int vlen)
 {
-  return @SPTR_NAME@ (new @NAME@ ());
+  return @SPTR_NAME@ (new @NAME@ (vlen));
 }
 
-@NAME@::@NAME@ ()
+@NAME@::@NAME@ (int vlen)
   : gr_sync_block ("@BASE_NAME@",
-                  gr_make_io_signature (1, -1, sizeof (@I_TYPE@)),
-                  gr_make_io_signature (1,  1, sizeof (@O_TYPE@)))
+                  gr_make_io_signature (1, -1, sizeof (@I_TYPE@)*vlen),
+                  gr_make_io_signature (1,  1, sizeof (@O_TYPE@)*vlen)),
+  d_vlen (vlen)
 {
 }
 
@@ -52,13 +53,13 @@ int
   int ninputs = input_items.size ();
 
   if (ninputs == 1){           // compute reciprocal
-    for (int i = 0; i < noutput_items; i++)
+    for (int i = 0; i < noutput_items*d_vlen; i++)
       *optr++ = (@O_TYPE@) ((@O_TYPE@) 1 /
                            ((@I_TYPE@ *) input_items[0])[i]);
   }
 
   else {
-    for (int i = 0; i < noutput_items; i++){
+    for (int i = 0; i < noutput_items*d_vlen; i++){
       @I_TYPE@ acc = ((@I_TYPE@ *) input_items[0])[i];
       for (int j = 1; j < ninputs; j++)
        acc /= ((@I_TYPE@ *) input_items[j])[i];