|
From: | Quentin Spencer |
Subject: | Re: octave "Most Wanted" feature |
Date: | Tue, 28 Nov 2006 15:59:18 -0600 |
User-agent: | Thunderbird 1.5.0.8 (X11/20061107) |
Przemek Klosowski wrote:
> > octave_index_origin (-256);Er, no. There are two choices, 0 and 1. There are no other choices.One interesting application of an offset that is neither 0 nor 1 is used for memory allocation in Numerical Recipes. For example, they allocate a 128-element vector and then subtract 128 from the allocation pointer 'v', to access v(129..256). Ugly hack, but it simplifies array offset expressions sometimes.
Another example the output of the fftshift function, which moves the DC frequency to the middle of a vector. Using a negative index origin would make it possible for the index to correspond directly to the frequency.
Quentin
[Prev in Thread] | Current Thread | [Next in Thread] |