I have written the following Julia code to build a sparse matrix of 
dimension N^2xN^2

https://gist.github.com/berceanu/fe7e26840637517383d8

The code works (probably in a very suboptimal way) for small enough 
matrices, but for example if I set N=1000, genspmat(1000) quickly eats up 
my RAM and crashes Julia. I doubt that this is related to the storage of 
the sparse matrix itself, and suspect it has to do with the garbage 
collection inside the main loop of genspmat, but I have no idea of fixing 
it. Any suggestions?

Thanks!

Reply via email to