<div dir="ltr"><div><div>Jed, one more <b><br><br>nnz cannot be greater than row length: local row 0 value 1 rowlength 0 </b><br><br></div>How do I deal with this error?<br><br></div>Thanks.<br><br>----<br>John Albequerque.<div class=""><div id=":9z" class="" tabindex="0"><img class="" src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"></div></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 19, 2016 at 8:17 PM, John Albequerque <span dir="ltr"><<a href="mailto:johncfdcfd@gmail.com" target="_blank">johncfdcfd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank you very much, I will try it.<br><br><br>Thanks<br><br>----<br>John Albequerque.<br><br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 19, 2016 at 8:16 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>John Albequerque <<a href="mailto:johncfdcfd@gmail.com" target="_blank">johncfdcfd@gmail.com</a>> writes:<br>
<br>
> So Jed, what you are suggesting is that I should set only the non-zero<br>
> elements while using<br>
</span>> * MatSetValues(A,(high-low),**idxm,nc,idxn,values,INSERT_*<br>
><br>
> *VALUES);*<br>
<span>> And not mention the zero elements and for that I should loop over all local<br>
> rows and then set each of the value.<br>
<br>
</span>Yes. The whole point of a sparse matrix is to spend no time or storage<br>
on 0.0 entries. If you allocate a dense matrix and store all the zeros,<br>
you're just being inefficient relative to a dense format.<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>