[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Speedup/Refaktoring loop? Extended...
From: |
Jaroslav Hajek |
Subject: |
Re: Speedup/Refaktoring loop? Extended... |
Date: |
Tue, 19 Aug 2008 13:20:42 +0200 |
> for iteration = 1:maxit
> for i=1:n
> a=transpose(U) * X;
> tmpU = transpose(U)*U;
> for j=1:columns
> b=tmpU*V;
> V(i,j)=V(i,j)* a(i,j)/b(i,j);
> end
> end
> for i=1:n
> tmpV=V*transpose(V);
> a=X*transpose(V);
> for k=1:rows
> b=U*tmpV;
> U(k,i)=U(k,i)*a(k,i)/b(k,i);
> end
> end
> end
>
>
> Do you see any chance to optimize this code for octave?
>
try:
for iteration = 1:maxit
a=transpose(U) * X;
tmpU = transpose(U)*U;
for i=1:n
bi=tmpU(i,:)*V;
V(i,:) = V(i,:) .* a(i,:) / b;
end
.. and analogously for the second loop
end
> Bye Andreas
>
>
>
> --
> Software Developer / Dipl. Inform. (FH)
> Max Planck Institute for Human Cognitive and Brain Sciences
> Department of Psychology
> Stephanstr. 1a, 04103 Leipzig, Germany
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
>
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
- Speedup/Refaktoring loop?, Andreas Romeyke, 2008/08/19
- Re: Speedup/Refaktoring loop?, Thomas Weber, 2008/08/19
- Re: Speedup/Refaktoring loop?, Jaroslav Hajek, 2008/08/19
- Re: Speedup/Refaktoring loop? Extended..., Andreas Romeyke, 2008/08/19
- Re: Speedup/Refaktoring loop? Extended...,
Jaroslav Hajek <=
- Re: Speedup/Refaktoring loop? Extended..., Andreas Romeyke, 2008/08/19
- Re: Speedup/Refaktoring loop? Extended..., Jaroslav Hajek, 2008/08/19
- Re: Speedup/Refaktoring loop? Extended..., Andreas Romeyke, 2008/08/27
- Re: Speedup/Refaktoring loop? Extended..., Dmitri A. Sergatskov, 2008/08/27
- Re: Speedup/Refaktoring loop? Extended..., David Bateman, 2008/08/27
- Re: Speedup/Refaktoring loop? Extended..., Andreas Romeyke, 2008/08/27
- Re: Speedup/Refaktoring loop? Extended..., John W. Eaton, 2008/08/27