|
From: | Yves Renard |
Subject: | Re: [Getfem-users] gmm++ sparse matrices |
Date: | Wed, 31 Oct 2012 09:49:14 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 |
Dear Laura Cattaneo, Your code indeed should work and modify the Mbar matrix. To be a liitle bit mor efficient, you could take non const iterators and replace the last line by *it_nz /= sum_row; Of course, when you iterate on a sparse vector and modify it, you have to care that the structure of the sparse vector is not modified (add or delete nonzero elements). Because in that case, the iterators are nolonger valid. In you case, this is ok. Yves. Le 31/10/2012 09:06, laura cattaneo a écrit : Dear all, -- Yves Renard (address@hidden) tel : (33) 04.72.43.87.08 Pole de Mathematiques, INSA-Lyon fax : (33) 04.72.43.85.29 20, rue Albert Einstein 69621 Villeurbanne Cedex, FRANCE http://math.univ-lyon1.fr/~renard --------- |
[Prev in Thread] | Current Thread | [Next in Thread] |