[julia-users] Re: help with generation of sparse matrix

2014-10-09 Thread Tony Kelman
If you're careful and know how the compressed sparse column format works, you can try generating the matrix column by column, doing in-place sorting of the row indices within each column. That would make it straightforward to construct the colptr and rowval vectors, and use the SparseMatrixCSC

[julia-users] Re: help with generation of sparse matrix

2014-10-09 Thread Viral Shah
With 24GB RAM, 12G for the input, and almost the same again for the sparse matrix generated will certainly run it dangerously close to the total memory. -viral On Tuesday, October 7, 2014 9:30:27 PM UTC+5:30, Iain Dunning wrote: > > Yes I think your estimate is correct: > > N => 10001 > k => 50

[julia-users] Re: help with generation of sparse matrix

2014-10-07 Thread Iain Dunning
Yes I think your estimate is correct: N => 10001 k => 500080001 num_bytes => 12001920024 num_bytes / 1024^3 => 11.177659057080746 When I run the code, it doesn't have any trouble allocating the 3 arrays (I have 16GB ram) and populating them (its pretty quick too), but it "freezes" when it gets

[julia-users] Re: help with generation of sparse matrix

2014-10-07 Thread Andrei Berceanu
Hi Iain, First of all thanks for your effort! I am using Julia 0.3.0 on Linux. The reason i wasn't preallocating was because I did not know the array sizes beforehand, but your suggestion of computing it works very well :) I just noticed that in my original post I put 1000 instead of 1. So,

[julia-users] Re: help with generation of sparse matrix

2014-10-07 Thread Iain Dunning
OK, on Julia 0.3.0 on OSX, for N=1001 elapsed time: 0.722537543 seconds (960169036 bytes allocated, 11.71% gc time) elapsed time: 0.703546159 seconds (955424928 bytes allocated, 26.01% gc time) elapsed time: 0.692751989 seconds (955424928 bytes allocated, 23.39% gc time) (first run includes JIT)

[julia-users] Re: help with generation of sparse matrix

2014-10-07 Thread Iain Dunning
At a glance, why build list only to just add it to J? Why not add it directly to J, and add i to I. If I have a chance I'll look further. Which Julia? On Monday, October 6, 2014 1:51:36 PM UTC-4, Andrei Berceanu wrote: > > I have written the following Julia code to build a sparse matrix of > d