octave-maintainers
[Top][All Lists]
Advanced

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

Re: compound operators


From: Jaroslav Hajek
Subject: Re: compound operators
Date: Thu, 8 May 2008 13:56:31 +0200

Another changeset uploaded; the symmetric cases A'*A, A*A', A.'*A and
A*A.' are now mapped to xSYRK and ZHERK. With these, the benchmark
becomes more impressive:

n = 50; m = 505000; a = rand(m,n); tic; c = a'*a; toc; clear

with current Octave:

Elapsed time is 4.24332 seconds.

with the new changeset:

Elapsed time is 0.916971 seconds.

i.e. a 462% speed-up (this is, of course, caused by the fact that
DSYRK not only avoids transposing and operates more cache coherently,
just like DGEMM('T','N',...), but also calculates only half of the
matrix)

what next?

My top candidates are expressions diag (v)*A, A*diag (v), diag (v) \
A, A / diag (v).
It would be possible to choose the same approach, and implement
mul_diag, diag_mul, div_diag, diag_ldiv.
But it seems that there are already special objects for diagonal
matrices and the special operations DiagMatrix * Matrix are already
there, it's just that octave_value is not (I think) specialized to
hold a DiagMatrix object. It seems that would be a better approach.

-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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