Hi,<div><br class="webkit-block-placeholder"></div><div>thanks for your replies!<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">
&gt; does clear() set all values to 0 for dense and sparse matrices? And if so:<br>&gt; Is that efficient for a freshly generated sparse matrix?<br></div>Why would you want to clear freshly generated sparse matrix ?<br>I thought it is semantically zero anyway ...
</blockquote><div><br class="webkit-block-placeholder"></div><div>Yes. But the problem in my case is: I really don&#39;t know whether I created a sparse or dense matrix, as that is defined by some typedef which I change depending on the use of the final binary. After that, I read in data and I want all values which are not present in the datafile to be zero. In the case of dense matrices, I would need to clear() it. That&#39;s why I wondered whether clear()ing a sparse matrix does any harm.
</div><div><br class="webkit-block-placeholder"></div><div>Thanks,</div><div><br class="webkit-block-placeholder"></div><div>Markus</div></div></div>