Hello,
I don't think you can really vectorize a calculation like that, but
it's pretty easy to recast it as a sparse matrix solve if you can
afford to fit all of the coefficients into memory. For your problem
you just end up with a bi-diagonal system, so you need about 2*n of
extra storage beyond just storing your solution vector. It's ~2
orders of magnitude faster than a for-loop too, and for more complex
operators you can use the built-in iterative solvers. For your
problem you'd have alpha down the main diagonal and (1-alpha) down the
first sub-diagonal, if A is your sparse matrix, your solution is just
x = A\b;
I wrote up an example in my blog a few days ago on this exact thing,
it's in the last half of this post:
http://j-stults.blogspot.com/2008/10/is-octave-slow.htmlHope that helps.
Cheers!
Josh
On Mon, Nov 3, 2008 at 4:01 PM, babelproofreader
<
babelproofreader@...> wrote:
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave