/* -*- 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)
{
}
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];