On Tue, Oct 19, 2010 at 07:45, vedaprakash subramanian <span dir="ltr"><<a href="mailto:vedaprakashsubramanian@gmail.com">vedaprakashsubramanian@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":v5">Can anyone tell the difference between MatMult() and KSP_MatMult(). <br></div></blockquote><div><br></div><div>If you're implementing a new KSP, it's worth reading the source:</div><div><br></div><div>
#define KSP_MatMult(ksp,A,x,y) (!ksp->transpose_solve) ? MatMult(A,x,y) : MatMultTranspose(A,x,y) </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":v5"><div>Can I use MatMult() inside the function KSPCreate_CGSTAB(KSP ksp)</div></div></blockquote></div><br><div>You should not be using MatMult in KSPCreate_XXX because the matrix may not exist yet. Whether to use KSP_MatMult depends on how you want to handle transpose solves. Note that many KSPs get away withh KSP_PCApplyBAorAB.</div>
<div><br></div><div>Jed</div>