Skip to content

Solving with sparse cholesky returns two-dimensional array #561

Closed
JuliaLang/julia
#30416
@clason

Description

@clason

In v1.0, using the Cholesky decomposition of a sparse array to solve a linear system for the transpose results in a two-dimensional array instead of a vector:

using LinearAlgebra,SparseArrays
N = 4
A = sparse(I,N,N)
C = cholesky(A)
b = randn(N)
C'\b

returns

4×1 Array{Float64,2}:
...

By contrast, C\b (correctly) returns

4-element Array{Float64,1}:
...

(The corresponding test for Array(I,N,N) throws a ERROR: MethodError: no method matching adjoint(::Cholesky{Float64,Array{Float64,2}}).)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsparseSparse arrays

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions