octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How should I do for effective solving simultaneous equations using LU de


From: Tatsuro MATSUOKA
Subject: How should I do for effective solving simultaneous equations using LU decomposition. (was Re: give me advise for bug #48085)
Date: Mon, 20 Jun 2016 15:10:29 +0900 (JST)

----- Original Message -----

> From: Tatsuro MATSUOKA 
> To: "octave-maintainers
> Date: 2016/6/20, Mon 07:41
> Subject: give me advise for bug #48085
> 
>T he bug #48085 is titled as 
> 
> Slow solving simultaneous equations by LU decomposition for octave 4 on 
> windows
> 
> 
> But the above is not valid due to an advise from Marco Caliari.
> 
> This post includes two issues
> 
> 1. Slowness of left division on 4.1.0+ on windows 
> 2. Slowness of left division by triangular matrix on octave ver. 4 
> 
> First one should be separated from the second one.
> Please visit bug tracker and give comments and advises.
> 
> http://savannah.gnu.org/bugs/?48085


From discussion with Dmitri, the bug tracker #48085 was my misleading.

However, at solving simultaneous Equations, the LU decomposition is not 
effective for current octave.

% lutest_vp2.m
more off 


Num=3000; ItNum=3000;
rand('seed',1); 
A=rand(Num)-0.5; 
rand('seed',2); 
B=rand(Num,ItNum)-0.5; 
disp('LU decomposition'); 
tic;
[L U P]=lu(A); 
toc;
% 
disp('Simple left division'); 
tic; 
x=A\B;  
toc; 
x1=x(:,end); 
% 
disp('LU decomposition'); 
disp('c=P*B');
tic; 
c=P*B;  
toc; 
disp('y=L\c');
tic; 
y=L\c; 
toc;
disp('x=U\y');
tic; 
x=U\y; 
toc;
x2=x(:,end); 
id=1:Num; 
plot(id,x1, 'o1',id,x2, '+2'); 
 % end of lutest_vp2.m

The above gives 
LU decomposition
Elapsed time is 0.866578 seconds.
Simple left division
Elapsed time is 1.93929 seconds.
LU decomposition
c=P*B
Elapsed time is 0.037025 seconds.
y=L\c
Elapsed time is 0.646434 seconds.
x=U\y
Elapsed time is 0.644429 seconds.
>> 0.866578+0.037025+0.646434+0.644429
ans =  2.1945

The LU decomposition does not give merit for solving simultaneous solutions.
Is this an expected behavior?
Am I misled?

I have asked how to use mldivide for block sparse matrices on linear-algebra 
package.
http://octave.1599824.n4.nabble.com/How-to-use-mldivide-for-block-sparse-matrices-on-linear-algebra-package-td4677775.html


but no replies.

If someone gives me comments and advises on this matter, it is grateful for me.

Tatsuro



reply via email to

[Prev in Thread] Current Thread [Next in Thread]