On Tue, Mar 8, 2011 at 7:10 AM, Tim Kroeger <span dir="ltr"><<a href="mailto:tim.kroeger@cevis.uni-bremen.de">tim.kroeger@cevis.uni-bremen.de</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;">
On Tue, 8 Mar 2011, Jose E. Roman wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 08/03/2011, Tim Kroeger wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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.<br>
</blockquote>
<br>
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: <a href="http://www.grycap.upv.es/slepc/documentation/current/src/examples/ex8.c.html" target="_blank">http://www.grycap.upv.es/slepc/documentation/current/src/examples/ex8.c.html</a><br>
<br>
PETSc itself provides some tools for approximating the extreme singular values of the preconditioned operator, see KSPComputeExtremeSingularValues.<br>
</blockquote>
<br>
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?<br>
</blockquote><div><br></div><div>It does not have to do with a shell matrix. It uses the projection of the operator into the Krylov space in the solver.</div><div>If there is a problem, mail all the error output (and possibly the stack trace) to petsc-maint.</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;">
Best Regards,<br>
<br>
Tim<br><font color="#888888">
<br>
-- <br>
Dr. Tim Kroeger<br>
CeVis -- Center of Complex Systems and Visualization<br>
University of Bremen <a href="mailto:tim.kroeger@cevis.uni-bremen.de" target="_blank">tim.kroeger@cevis.uni-bremen.de</a><br>
Universitaetsallee 29 <a href="mailto:tim.kroeger@mevis.fraunhofer.de" target="_blank">tim.kroeger@mevis.fraunhofer.de</a><br>
D-28359 Bremen Phone +49-421-218-59246<br>
Germany Fax +49-421-218-59277<br>
</font></blockquote></div><br><br clear="all"><br>-- <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<br>