JuliaArrays / JuliaArrays/StaticArrays.jl

Inverse of symmetric static arrays returns errors

Open
#955 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

linear-algebra
Dominant language
Julia
Stars
844
Forks
159
Avg merge
3d 21h
Merged PRs (30d)
3

Description

MWE:

using LinearAlgebra
using StaticArrays

my_matrix = [
    23.839174539658693 243552.4933521217 1.8416855269559405e9 7262.007338486136 -0.15093214378094674 -0.08311979038696746; 
    243552.4933521217 2.962601669841655e9 1.565059094802e13 7.454589007612145e7 -1822.7229289215243 -703.6834309479851; 
    1.8416855269559405e9 1.565059094802e13 1.852842171814476e17 5.52741246224e11 -9.820212598493524e6 -8.437622282150278e6; 
    7262.007338486136 7.454589007612145e7 5.52741246224e11 2.214925230782032e6 -46.13837676487657 -24.926993518175713; 
    -0.15093214378094674 -1822.7229289215243 -9.820212598493524e6 -46.13837676487657 0.0011236787686097864 0.00044192488231854755; 
    -0.08311979038696746 -703.6834309479851 -8.437622282150278e6 -24.926993518175713 0.00044192488231854755 0.0003843024068388386
    ]
my_static_matrix = @SMatrix[
    23.839174539658693 243552.4933521217 1.8416855269559405e9 7262.007338486136 -0.15093214378094674 -0.08311979038696746; 
    243552.4933521217 2.962601669841655e9 1.565059094802e13 7.454589007612145e7 -1822.7229289215243 -703.6834309479851; 
    1.8416855269559405e9 1.565059094802e13 1.852842171814476e17 5.52741246224e11 -9.820212598493524e6 -8.437622282150278e6; 
    7262.007338486136 7.454589007612145e7 5.52741246224e11 2.214925230782032e6 -46.13837676487657 -24.926993518175713; 
    -0.15093214378094674 -1822.7229289215243 -9.820212598493524e6 -46.13837676487657 0.0011236787686097864 0.00044192488231854755; 
    -0.08311979038696746 -703.6834309479851 -8.437622282150278e6 -24.926993518175713 0.00044192488231854755 0.0003843024068388386
    ]

my_symmetric_matrix = Symmetric(my_matrix)
my_symmetric_static_matrix = Symmetric(my_static_matrix)

myinversion = inv(my_symmetric_matrix)
mystaticinversion = inv(my_symmetric_static_matrix)

Returns

ERROR: LoadError: MethodError: no method matching bunchkaufman!(::Symmetric{Float64, SMatrix{6, 6, Float64, 36}}, ::Bool; check=true)

On Julia 1.6.0

Apologies for the unnecessarily large matrix, I'm copying this from some work I was originally trying to do for a model I'm getting the covariance matric of through the inverse Hessian.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the MWE on Julia 1.6.0 with StaticArrays and compare inv(Symmetric(my_matrix)) against inv(Symmetric(my_static_matrix)). Trace the failing bunchkaufman! call and confirm that inversion of the symmetric SMatrix completes without the reported MethodError.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.