|Re: [eigen] Valid use case for creating a SparseMatrix?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Valid use case for creating a SparseMatrix?
- From: Bill Greene <w.h.greene@xxxxxxxxx>
- Date: Thu, 7 Apr 2011 09:46:52 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=IfSQDthMUUhp8MKj4mORb7Jg5otM3OyCyCbs3NGCmds=; b=Zz/6x7vyklyEFBjPtl9GF4A0ezZBY19iM/WuRTlOem5XI7Vx+jnPS27qOZ/6hskYzx a+4oKZUxX1hpHWO/y8GQNBPTjlm5zT+F+vC52EFzNbhLAxHyPXztP2ZhcbuIFs+yyitL GTFKslSs6BHl3+6uIPKk50kh6nsc+RJS2P2io=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fUwuGHQbWgFQVEf92PjJrTIxW3/w0Texc+jfj7RHFmGzeyttYe+OGHo+YKbflxO0RW j2Pc7HWGon+tcpLRu62NOL910Uc7SAeNyoXFFI5qPL+cyNrbMbX0fKyBobc3BmH2Ewdu rHGEb+1Nz9iMZSR8iI/7IrjRAB83sWGGoMfhE=
I have exactly this use case myself but have been
somewhat reluctant to mention it because my feeling,
too, is that it is somewhat rare. (My solution too was
to first read all entries into a deque and then, after
finding the number of rows and columns, move the
entries to SparseMatrix.) So it would be useful
to me also if Eigen could support this scenario.
For what its worth, other sparse matrix packages
support this general insert "mode" in a somewhat
different way than Gael is proposing. They typically
allow a user to input (row, col, value) triplets in an
arbitrary order. Then, at the end of this input process,
some kind of convert operation changes their state
into CSC or CSR format. Obviously, there is some
kind of flag to indicate the state of the object. The
SPOOLES and Tim Davis' CSparse packages (among others) work
this way. The downside of this approach
is that every method that operates on one of these
sparse matrix objects has to check this state flag and
decide whether to support both states or simply issue
an error if the object is not in a supported state.
Is the current plan to keep or eliminate DynamicSparseMatrix?
How about an extended, more flexible version of that class?