|
From: | Rui Maciel |
Subject: | Re: ASCII file format for sparse matrices? |
Date: | Fri, 13 May 2011 20:08:54 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 |
On 05/13/2011 02:06 PM, Jordi Gutiérrez Hermoso wrote:
I've just took a peek at the source code and, at least at first glance, it doesn't look like it takes that much work to implement a proper "dictionary of keys" format. Well, it won't take that much work provided that it's possible to declare a temporary std::list for the DoK coefficients, import all [i,j,value] triplets into that list, sort the list in order of j and i and then fill the Sparse<T>& a object as before.Probably not, unless they are your plans. This is the source file that you can begin inspecting to provide a patch: http://hg.savannah.gnu.org/hgweb/octave/file/tip/src/ov-base-sparse.cc#l396 Note that most of the work is done in op>> here: http://hg.savannah.gnu.org/hgweb/octave/file/tip/liboctave/dSparse.cc#l7599 Which as you can see, is just a thin wrapper of the actual read_sparse_matrix function: http://hg.savannah.gnu.org/hgweb/octave/file/tip/liboctave/Sparse.h#l586 The actual sparse representation right now only is CCS. It would probably take a significant amount of rewriting much of the sparse matrix code if you have another representation in mind. However, if all you want is to extend the flexibility of the load command, that can probably be arranged.
So, basically if it's possible to add a std::list dependency to liboctave/Sparse.h then I believe I can pull it off.
Any thoughts? Rui Maciel
[Prev in Thread] | Current Thread | [Next in Thread] |