[petsc-users] Condition number of a matrix

Matthew Knepley knepley at gmail.com
Tue Mar 8 07:16:23 CST 2011


On Tue, Mar 8, 2011 at 7:10 AM, Tim Kroeger <tim.kroeger at cevis.uni-bremen.de
> wrote:

> On Tue, 8 Mar 2011, Jose E. Roman wrote:
>
>  On 08/03/2011, Tim Kroeger wrote:
>>
>>  Is there some possibility in PETSc to compute (an approximation to) the
>>> condition number of a matrix?  The matrix is a rank-1 modification of a
>>> sparse matrix, and I am anyway using SuperLU_Dist to compute a factorization
>>> of the matrix.  The matrix is about 70000 times 70000.
>>>
>>
>> You can compute the condition number as the ratio of the largest to the
>> smallest singular value (or eigenvalue in case of symmetric matrices). With
>> SLEPc you can compute either eigenvalues or singular values. Here is an
>> example that computes the condition number:
>> http://www.grycap.upv.es/slepc/documentation/current/src/examples/ex8.c.html
>>
>> PETSc itself provides some tools for approximating the extreme singular
>> values of the preconditioned operator, see KSPComputeExtremeSingularValues.
>>
>
> Thank you for your help.  Following the notes in the manual page for
> KSPComputeExtremeSingularValues(), I tried -ksp_monitor_singular_value as a
> first approach, but this causes my application to crash.  I should say that
> the matrix is a ShellMat, consisting of a sum of a rank-1 matrix and a
> sparse matrix, where the sparse matrix has been factored by SuperLU_Dist.
>  (I think this was somehow misleading in my previous email.)  I suspect that
> my ShellMat misses some operation that is required, but I have no idea which
> that is.  Could you please let me know which operations are required for a
> ShellMat to enable -ksp_monitor_singular_value?
>

It does not have to do with a shell matrix. It uses the projection of the
operator into the Krylov space in the solver.
If there is a problem, mail all the error output (and possibly the stack
trace) to petsc-maint.

    Matt


> Best Regards,
>
> Tim
>
> --
> Dr. Tim Kroeger
> CeVis -- Center of Complex Systems and Visualization
> University of Bremen              tim.kroeger at cevis.uni-bremen.de
> Universitaetsallee 29             tim.kroeger at mevis.fraunhofer.de
> D-28359 Bremen                            Phone +49-421-218-59246
> Germany                                   Fax   +49-421-218-59277
>



-- 
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/20110308/c0d8dc46/attachment-0001.htm>


More information about the petsc-users mailing list