discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Layer Mapper in GnuRadio


From: Josh Blum
Subject: Re: [Discuss-gnuradio] Layer Mapper in GnuRadio
Date: Sun, 28 Apr 2013 22:37:25 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

> In The General Work Function I wanted to create 4 outputs this way:
> 
> int
>     Layer_Mapper_Transmit_Diversity_cc_impl::general_work (int
> noutput_items,
>                        gr_vector_int &ninput_items,
>                        gr_vector_const_void_star &input_items,
>                        gr_vector_void_star &output_items)
>     {
>         const float **in = (const float **) input_items[0];
>         float **out0 = (float **) output_items[0];
>         float **out1 = (float **) output_items[1];
>         float **out2 = (float **) output_items[2];
>         float **out3 = (float **) output_items[3];
> 
> Because the inputs and outputs are arrays so I declared them as matrices ,
> does GnuRadio accept this ?
> 
> 

So input_items[0] or output_items[1] for example, is a pointer to a
linear chunk of memory. Casting it to a float ** might imply that its an
array of pointers which each point to a linear row/column of a matrix.
But that isnt the case, so things will likely segfault.

You could cast the pointer to a C matrix with the double brackets and
the fixed widths like a [64][4] for example, I think C will map those
double bracketed access nicely to a linear chunk of memory.

I hope that helps!
-josh

> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 



reply via email to

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