[petsc-users] Condition number of a matrix

Tim Kroeger tim.kroeger at cevis.uni-bremen.de
Tue Mar 8 07:10:50 CST 2011


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?

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


More information about the petsc-users mailing list