help-octave
[Top][All Lists]
Advanced

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

Re: help with vectorization of update rule


From: Søren Hauberg
Subject: Re: help with vectorization of update rule
Date: Fri, 22 Oct 2010 13:01:26 +0200

fre, 22 10 2010 kl. 01:56 -0700, skrev grg:
> 
> Søren Hauberg wrote:
> > 
> > Try the following (more simple solution):
> > 
> >     z = x0 * (A.^(0:T));
> > 
> > 
> 
> 
> Hi Søren and John,
> 
> You are both indeed right: if T is increased to a number larger than 20, the
> 1st vectorized version of the code is faster than the loop, and the latest
> is even faster.
> 
> However, I've just realized that yesterday I missed an important thing.
> In my problem A is a *matrix*, not a scalar as in the examples.
> 
> That was indeed my initial question.  How to compute efficiently (i.e.,
> without a loop) A.^t, when size(A)=[s s], and size(t)=[1 T].

That changes things quite drastically. I don't have any immediate tricks
as Octave doesn't seem to do the needed tensor stuff to use the same
trick as before.

Søren



reply via email to

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