[petsc-users] How to set L1 norm as the converge test?

Matthew Knepley knepley at gmail.com
Wed Sep 24 18:13:04 CDT 2014


On Wed, Sep 24, 2014 at 6:08 PM, Brian Yang <brianyang1106 at gmail.com> wrote:

> For LSQR,
> http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/impls/lsqr/lsqr.c.html#KSPLSQR
>
> 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.
>
> I am just wondering whether I could replace NORM2 to NORM1 and remove
> related square (or square root) operations to achieve my goal?
>

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
is to have a mathematically consistent way of using the L1 norm, then no
you will have to use a different solver.

  Thanks,

     Matt


> Thanks.
>
> On Wed, Sep 24, 2014 at 3:48 PM, Brian Yang <brianyang1106 at gmail.com>
> wrote:
>
>> Thanks everyone, I will try KSPSetConvergenceTest to test.
>>
>> On Wed, Sep 24, 2014 at 2:54 PM, Jed Brown <jed at jedbrown.org> wrote:
>>
>>> Matthew Knepley <knepley at gmail.com> writes:
>>>
>>> > On Wed, Sep 24, 2014 at 2:31 PM, Barry Smith <bsmith at mcs.anl.gov>
>>> wrote:
>>> >
>>> >>
>>> >>   Brian,
>>> >>
>>> >>     Your convergence test routine could call KSPBuildResidual() and
>>> then
>>> >> compute the 1-norm of the residual and make any decision it likes
>>> based on
>>> >> that norm.  See KSPSetConvergenceTest()
>>> >
>>> >
>>> > Note that what Barry is saying is that the convergence theory for CG
>>> > guarantees monotonicity in the energy (A) norm, but says nothing
>>> > about L1 so you might get crap.
>>>
>>> Moreover, if you have an overdetermined linear system, but want to
>>> minimize the 1-norm of the residual (instead of the 2-norm that least
>>> squares minimizes), you are actually asking to solve a "linear program"
>>> and need to use an LP solver (a very different algorithm).
>>>
>>> If you merely watch the 1-norm of the residual, it might increase as the
>>> least squares solver converges.
>>>
>>
>>
>>
>> --
>> Brian Yang
>> U of Houston
>>
>>
>>
>>
>
>
> --
> Brian Yang
> U of Houston
>
>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140924/e34a0de8/attachment-0001.html>


More information about the petsc-users mailing list