[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: X'*v in octave
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: X'*v in octave |
Date: |
Fri, 22 May 2015 10:11:31 -0400 |
On Fri, 2015-05-22 at 05:05 +0800, Chih-Jen Lin wrote:
> Recently in an experiment I found that for sparse X'*v octave seems
> to do X' first and then conduct the matrix vector product. This is
> time consuming as this operation is simple a linear combination of
> X's columns and X in Octave is stored in compressed column format.
I may be completely mistaken here, but I think that Octave is already
doing what you suggest. If you attempt the following,
x = sprand(1e5,1e5,0.0001);
y = rand(1e4,1);
then of the possible operations of interest,
tic; x*y; toc
tic; y'*x; toc
tic; x'*y; toc
the third one is the fastest. Are you seeing one of the two others as
being faster?
- Jordi G. H.