<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Oct 17, 2015 at 11:12 AM, Václav Hapla <span dir="ltr"><<a href="mailto:vaclav.hapla@vsb.cz" target="_blank">vaclav.hapla@vsb.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes, exactly, MATSHELL.<br>
But if I am right, MatShellSetOperation sets mat->ops->mult pointer directly to user-specified MatMult unless MatShellUseScaledMethods has been called.<br>
So user must keep in mind he should call PetscObjectStateIncrease in his MatMult.<br>
I feel like this is something one would intuitively await from the interface function...<br>
It would be less error-prone for future and user-implemented MatTypes.<br></blockquote><div><br></div><div>That removes the ability to leave the vector unchanged by an implementor.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Vaclav<br>
<br>
Dne 17.10.2015 v 17:58 Barry Smith napsal(a):<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Oct 17, 2015, at 5:10 AM, Václav Hapla <<a href="mailto:vaclav.hapla@vsb.cz" target="_blank">vaclav.hapla@vsb.cz</a>> wrote:<br>
<br>
Hello,<br>
MatMult(), MatMultTranspose(), MatMultAdd(), MatMultTransposeAdd() and PCApply() belong to most common modifiers of Vec values.<br>
Maybe it would be nice if these routines called PetscObjectStateIncrease explicitly because of MATSHELL and such stuff.<br>
Thanks,<br>
Vaclav<br>
</blockquote>
    I assume you are suggesting this because users of MATSHELL or PCSHELL may not realize they need to call PetscObjectStateIncrease() on the output vector if they do not use VecGe/RestoretArray() to access the vector entries? (VecRestoreArray() automatically increases the state)<br>
<br>
    What if we add it to MatMult_Shell(), MatMultTranspose_Shell(), PCApply_Shell() and PCApplyTranspose_Shell()?  It looks like those are the only ones where the state won't get increased automatically<br>
<br>
    Thanks for the suggestion,<br>
<br>
   Barry<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-- <br>
<br>
Vaclav Hapla<br>
Junior researcher<br>
IT4Innovations <<a href="http://www.it4i.eu/" rel="noreferrer" target="_blank">http://www.it4i.eu/</a>><br>
<br>
<br>
</blockquote></blockquote>
<br>
-- <br>
<br>
Vaclav Hapla<br>
Junior researcher<br>
IT4Innovations <<a href="http://www.it4i.eu/" rel="noreferrer" target="_blank">http://www.it4i.eu/</a>><br>
<br>
*office*<br>
phone: <a href="tel:%28%2B420%29%20597%2032%209662" value="+420597329662" target="_blank">(+420) 597 32 9662</a><br>
room 310<br>
IT4Innovations building<br>
Studentska 6231/1B<br>
708 00 Ostrava - Poruba<br>
Czech Republic<br>
<br>
*contact address*<br>
Vaclav Hapla<br>
IT4Innovations<br>
VSB - Technical University of Ostrava<br>
17. listopadu 15/2172<br>
708 33 Ostrava - Poruba<br>
Czech Republic<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>