[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help with vectorization of update rule
From: |
grg |
Subject: |
Re: help with vectorization of update rule |
Date: |
Fri, 22 Oct 2010 01:56:12 -0700 (PDT) |
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].
Thanks again for your previous input.
Giorgio
--
View this message in context:
http://octave.1599824.n4.nabble.com/help-with-vectorization-of-update-rule-tp3005798p3006844.html
Sent from the Octave - General mailing list archive at Nabble.com.
- help with vectorization of update rule, grg, 2010/10/21
- help with vectorization of update rule, grg, 2010/10/21
- Re: help with vectorization of update rule, Søren Hauberg, 2010/10/21
- Re: help with vectorization of update rule, Søren Hauberg, 2010/10/22
- Re: help with vectorization of update rule,
grg <=
- Re: help with vectorization of update rule, Søren Hauberg, 2010/10/22
- Re: help with vectorization of update rule, Moo, 2010/10/23
- Re: help with vectorization of update rule, Jaroslav Hajek, 2010/10/25