Blitz logo

Blitz Support :

From: Todd Veldhuizen (tveldhui_at_[hidden])
Date: 2003-07-20 12:14:02


Hi Navneet,

Try simply

   Array<double,1> b = a(5, Range::all());

See the slicing section of the manual for more detail:
http://www.oonumerics.org/blitz/manual/blitz02.html#index00087

Cheers,
Todd

-- 
Todd Veldhuizen  /  tveldhui_at_[hidden]  /  Indiana University Computer Science
On Thu, 17 Jul 2003, Dalal, Navneet wrote:
> Hi,
>
> I am writing bilinear interpolation code using blitz arrays. I would like to
> write this code for general N-d arrays using meta programming.
>
> However, I am stuck with one problem: how can I get a sub array along one
> particular dimension for a blitz array ?
>
> What I need is something like this:
>
> Array<double, 2> a (10, 10);
> // init a
>
> int index = 5;
> int firstDimension = 0;
>
> Array<double,1> b = a.subarray(firstDimension, index);
>
> // now b points to a(5, range::all)
>
>
>
> Is there a function or operator already overloaded for this purpose?
>
> thanks
> navneet
> _______________________________________________
> Blitz-support mailing list
> Blitz-support_at_[hidden]
> http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>