[Top][All Lists]

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

Re: vectorization

From: Nidjara
Subject: Re: vectorization
Date: Mon, 12 Jan 2015 02:54:19 -0800 (PST)

You guys are great!

I'm working with very large matrices (2-7 millions of rows), so this sub2ind
and in general linear indexing couldn't work (the index numbers become too

Helios's solution works like charm, and it fills matrix so much faster than
with loop (I'm using sparse matrix:). So thanks a lot.

Related to this. What I actually do in my program is: read large amount of
data from a structured text file (graph .dot format), store it into sparse
matrix G, and then do some linear algebra with G .

The code to load the data is:

      [L1, L2, L3]= textread(fileinput,'%d -> %d
      G=sparse(L1+1, L2+1, L3, dim, dim);

Now the bottleneck is line with textread, which takes 99% of the code
execution. Any ideas of a faster way to load the data? (I have data in .dot,
graphml and .csv format)

View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

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