[scilab-Users] vectorization

Serge Steer serge.steer at inria.fr
Mon Oct 3 20:42:08 CEST 2011


Oups, You are right, it is better computing S'*x0 once. Serge ----- Mail original -----
> De: "Adrien Vogt-Schilb" <vogt at centre-cired.fr>
> À: users at lists.scilab.org
> Envoyé: Lundi 3 Octobre 2011 18:15:11
> Objet: Re: [scilab-Users] vectorization
> On 03/10/2011 18:08, Serge Steer wrote:
> > R=rand(5,5);R=R+R';//creates a symmetric matrix
> > [S,K]=schur(R) //R=S*K*S';
> > K=diag(K);
> > E=exp(K*t)
> > x=zeros(size(x0,'*'), size(t,'*'))
> > for i=1:size(t,'*')
> > x(:,i)=S*diag(E(:,i)*S'*x0
> > end
> > Here you can also use the ode solver to do the job
> Serge,
> do you know if x(:,i)=S*diag(E(:,i)*S'*x0 has to compute S' each time?
> or the parser is smart enough to compute S'*x0 without computing S' ?
> if not, when t is very large, one should calculate S' once before the
> loop, don't you think?
> --
> Adrien Vogt-Schilb (Cired)
> Tel: (+33) 1 43 94 73 77
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20111003/111029e6/attachment.htm>


More information about the users mailing list