<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Sep 24, 2014 at 6:08 PM, Brian Yang <span dir="ltr"><<a href="mailto:brianyang1106@gmail.com" target="_blank">brianyang1106@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"><div><div>For LSQR, <a href="http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/impls/lsqr/lsqr.c.html#KSPLSQR" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/impls/lsqr/lsqr.c.html#KSPLSQR</a><br></div><div><br>I checked the lsqr.c implementation, within routine KSPSolve_LSQR, I saw few places using VecNorm and before KSP_Monitor to output the rnorm, there were many intermediate updates for the iteration.<br><br></div>I am just wondering whether I could replace NORM2 to NORM1 and remove related square (or square root) operations to achieve my goal?<br></div></div></blockquote><div><br></div><div>I think the depends on your goal. If it is the print the L1 norm out, then the monitor or convergence test is enough. If it</div><div>is to have a mathematically consistent way of using the L1 norm, then no you will have to use a different solver.</div><div><br></div><div>  Thanks,</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"><div dir="ltr"><div></div>Thanks.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 24, 2014 at 3:48 PM, Brian Yang <span dir="ltr"><<a href="mailto:brianyang1106@gmail.com" target="_blank">brianyang1106@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">Thanks everyone, I will try <span>KSPSetConvergenceTest to test.<br></span></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On Wed, Sep 24, 2014 at 2:54 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>Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> writes:<br>
<br>
> On Wed, Sep 24, 2014 at 2:31 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:<br>
><br>
>><br>
>>   Brian,<br>
>><br>
>>     Your convergence test routine could call KSPBuildResidual() and then<br>
>> compute the 1-norm of the residual and make any decision it likes based on<br>
>> that norm.  See KSPSetConvergenceTest()<br>
><br>
><br>
> Note that what Barry is saying is that the convergence theory for CG<br>
> guarantees monotonicity in the energy (A) norm, but says nothing<br>
> about L1 so you might get crap.<br>
<br>
</span>Moreover, if you have an overdetermined linear system, but want to<br>
minimize the 1-norm of the residual (instead of the 2-norm that least<br>
squares minimizes), you are actually asking to solve a "linear program"<br>
and need to use an LP solver (a very different algorithm).<br>
<br>
If you merely watch the 1-norm of the residual, it might increase as the<br>
least squares solver converges.<br>
</blockquote></div><br><br clear="all"><span class="HOEnZb"><font color="#888888"><br></font></span></div></div><span class="HOEnZb"><font color="#888888"><span>-- <br>Brian Yang<br>U of Houston<br><br><br><br>
</span></font></span></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br>Brian Yang<br>U of Houston<br><br><br><br>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>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>