|Re: [eigen] Copy into a MappedSparseMatrix|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Copy into a MappedSparseMatrix
- From: Norman Goldstein <normvcr@xxxxxxxxx>
- Date: Thu, 16 Jul 2015 10:18:17 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=telus.net; s=neo; t=1437067097; bh=KzBeJYFPhzJaUBBsLpp3OZIzjQKC/TXfHLy83U2t8Z4=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=G/raEpjY+F21LKJdhYaQJk9RnLJaQi4gBU2fkLBDRms319L/gADFQyOij3N2ediGD Bosyfl5c6iy/rr6JlAXkn8JvcQT+VAglkrH6Tbyb23GI1wsTXF/FfKU1DTSurXSeXa 2bd4YjSKKstM9b12KuAydUDP6FmZ+V0A2RsIolegxIExX3kl108zfhj3NDFfVgwWGB Q/XKWwYUFlaYvaLeMLG4hFY2KC55aAN0pldu0xI7cL3DBOPqoPE3+sX8BQkQQgAcK4 6gZDCZUxGPQo7jubVA2VjP/OjjKcxvABGuEswKGewNldI9TIxmNRYzzTzXcvEKhr0n IJZcQQP63NRXg==
On 07/16/2015 09:27 AM, Christoph Hertzberg wrote:
On 16.07.2015 at 17:22, Norman Goldstein wrote:
So, copy( a, b ) works, but copy( a*b, c ) does not work.
Directly assigning a product to a MappedSparseMatrix won't work, since
the number of non zeros are not known beforehand, so you need to
evaluate into a temporary anyways. The reason why your code does not
automatically convert into a temporary is that implicit type
conversions are disabled for templated functions.
I still don't understand why you want to assign your result to a
I am interfacing Eigen to another library, and I would prefer to do the
directly into the other's data structures. No big deal, though -- this
is not a critical section of code.
N.B.: I thought about "recomputing" sparse products (without
re-allocating) quite a while ago
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=385), but never found it
important enough to further work on that. If someone wants to work on
that, contributions are welcome.
The bug report states:
Moreover it might be possible to 'recompute' a Sparse*Sparse product
where the structure did not change thus no overhead for reallocation would arise.
Eigen already does sparse sparse products, so there is already the
for calculating the number of (structural/symbolic) nonzeros in the
product. I suppose
I don't understand the expression evaluation infrastructure of Eigen
well enough to wrap
my mind around the actual problem that this upgrade would entail.