Re: [firedrake] square root of matrix
Thanks Patrick, this is useful. all the best --cjc On 14 February 2017 at 16:29, Patrick Farrell < patrick.farrell@maths.ox.ac.uk> wrote:
On 14/02/17 08:21, Colin Cotter wrote:
Dear all, For weird reasons I'd like to solve Ux = y where U is the Cholesky square root of a given symmetric positive definite matrix A. Is there a way to abuse the PETSc solver interface into doing this?
Hi Colin,
I have partial information about your question.
I need to access the Cholesky factorisation data to verify the second-order sufficiency conditions for constrained minimisation problems. (I'm using dolfin, but it shouldn't matter very much for your purposes.) My petsc4py code looks like
pc = PETSc.PC().create(comm) pc.setOperators(A.mat()) pc.setType("cholesky") pc.setFactorSolverPackage("mumps") pc.setUp()
to calculate the Cholesky factorisation, then
F = pc.getFactorMatrix() (neg, zero, pos) = F.getInertia()
to compute the inertia of the matrix. (I also need some MUMPS options, but I presume you don't care about these, since you're not asking it to compute the inertia.)
Maybe you can get the sparse matrix representation out of F and solve a linear system with it, who knows.
Cheerio,
Patrick
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
-- http://www.imperial.ac.uk/people/colin.cotter www.cambridge.org/9781107663916
participants (1)
- 
                
                Colin Cotter