Re: How to vectorize functions like eig()
- From: "Stephane Carlier" <youfellow@xxxxxxxxxxx>
- Date: Thu, 7 Feb 2008 17:10:03 +0000 (UTC)
This is exactly the "for loop" I wish to avoid. I am not
talking about only 4 matrices. Actually the problem I have
involves about 2e6 matrices. I had a similar problem with
2x2 matrices, but luckily I can derive an analytical
solution for eigenvalues for 2x2 matrices. The speed
improvement of my analytical solution vs eig() loop is about
60x faster. For 3x3 matrices, the analytical solution is
still possible. But before I invest all the time in coding
those fairly complicated equations, I wish to know if the
numerical method can be faster than the analytical method.
i could very well be wrong, but i think eig() only takes 2-
d matrices. i'd like to think, though, that the optimizer
should make a for-loop fairly quick if you just indexed the
big array and called eig on its sections:
% 4 3x3 matrices
eig(mat(i:i+2,:))mat=rand([12 3]);
for i = 1:3:length(mat)
end
something in that form shouldn't be too taxing although
it's not "vectorized"...
.
- Follow-Ups:
- Re: How to vectorize functions like eig()
- From: Arthur G
- Re: How to vectorize functions like eig()
- References:
- How to vectorize functions like eig()
- From: Stephane Carlier
- Re: How to vectorize functions like eig()
- From: Ian Clarkson
- How to vectorize functions like eig()
- Prev by Date: Popupmenu -- Color selection
- Next by Date: Re: single precision versus double precision speed
- Previous by thread: Re: How to vectorize functions like eig()
- Next by thread: Re: How to vectorize functions like eig()
- Index(es):
Relevant Pages
|
Loading