Skip to content

Support cholesky check argument. #133

@btmit

Description

@btmit

Currently passing this argument is causing dispatch back to the original LinearAlgebra methods.

Here's a first cut at replacing the existing method:

function LinearAlgebra.cholesky(B::BlockDiagonal{T,M}; check=true)::Cholesky where {T,M}
    N = nblocks(B)
    blks = Vector{M}(undef, N)
    valid = true
    for (i, b) in enumerate(blocks(B))
        c = cholesky(b; check)
        valid = valid && issuccess(c)
        blks[i] = parent(UpperTriangular(c.U))
    end
    return Cholesky(BlockDiagonal(blks), 'U', valid ? 0 : -1)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions