finding inverse of 3D matrix for speed
1 回表示 (過去 30 日間)
古いコメントを表示
Hi ..
In a 1D simulation, I have 'n' number of grid points and at each point, some data is stored in 3x3 matrix (A). For simplicity, lets say
tic;
n= 200000;
A = rand(3,3,n);
for i = 1:n
iA(:,:,i) = inv(A(:,:,i));
end
toc; Elapsed time is 0.536919 seconds.
With this the code is too slow because of the for loop. If there is any other efficient way anyone knows, pl suggest. The usual way of using "iA = inv(A)" fails as the matrix need to be 2D for using that command.
Thanks.
0 件のコメント
回答 (1 件)
James Tursa
2015 年 7 月 1 日
編集済み: James Tursa
2015 年 7 月 1 日
See this small size linear solver by Bruno Luong:
and you might be interested in this one as well:
If you have a C compiler, you could consider this submission by Yuval also:
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!