Skip to content

Issue with LQ decomposition of JLMatrix in MatrixAlgebraKit v0.6.6 #218

Description

@mtfishman
julia> using JLArrays, MatrixAlgebraKit, StableRNGs

julia> rng = StableRNG(1234)
StableRNGs.LehmerRNG(state=0x000000000000000000000000000009a5)

julia> A = randn(rng, (5, 5))
5×5 Matrix{Float64}:
  0.519495  -0.686151   -0.880175  -0.806765   -0.452884
  0.90514    0.0922364   1.6719     0.420992   -0.0804358
 -1.67566   -0.0896371  -0.145425   0.673602   -0.951142
 -1.29473   -1.4521     -0.407636  -0.0605749  -0.110243
 -0.684365  -1.90761     0.534391   0.0528423   0.43785

julia> L, Q = lq_full(A); L * Q - A
5×5 Matrix{Float64}:
 -1.11022e-16   0.0           0.0           0.0           5.55112e-17
  6.66134e-16  -1.38778e-17  -2.22045e-16  -2.22045e-16  -1.52656e-16
 -1.11022e-15   6.93889e-17   3.05311e-16   2.22045e-16   3.33067e-16
 -8.88178e-16   2.22045e-16  -2.22045e-16   1.80411e-16   9.71445e-17
  0.0           8.88178e-16  -5.55112e-16   4.23273e-16  -3.33067e-16

julia> L, Q = lq_full(jl(A)); L * Q - jl(A)
5×5 JLArray{Float64, 2}:
 -1.11022e-16   0.0        0.0        0.0        5.55112e-17
  0.59931      -0.791571  -1.0154    -0.930716  -0.522465
  1.83757      -0.83466    0.850446  -0.594897  -0.725654
  1.83807       0.769372   1.43098    0.018752   1.57879
  0.302917      0.579446  -0.211197  -0.1211     1.16489

(jl_fqWJ2N) pkg> st
Status `/private/var/folders/qz/q22pzwm144z9fq57mpf1hfp40000gq/T/jl_fqWJ2N/Project.toml`
  [27aeb0d3] JLArrays v0.3.1
  [6c742aac] MatrixAlgebraKit v0.6.6
  [860ef19b] StableRNGs v1.0.4

Also affects lq_compact and right_orth. QR decompositions seem to be fine.

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