Skip to content

isposdef not defined for symmetric matrices #422

Closed
JuliaLang/julia
#21561
@mcopik

Description

The standard linalg function isposdef does not work for symmetric matrices (recent git master):

x = rand(5, 5)
x = x*x'
isposdef(x)
isposdef(Symmetric(x))

The last line fails with an error:

ERROR: MethodError: no method matching isposdef!(::Symmetric{Float64,Array{Float64,2}})

which I guess is caused by a missing definition. One workaround is to access underlying matrix directly but it is inconvenient:

isposdef(Symmetric(x).data)

I think this behavior is not correct and surprising for each user, I have not found any mention of such limitation in the documentation. There is an additional implementation for Diagonal matrices and this works fine:

isposdef(Diagonal(rand(1, 5)))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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