JuliaArrays / JuliaArrays/StaticArrays.jl

cholesky! does not modify MMatrix

Open
#1,260 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I am fairly new to using StaticArrays, so I do not know if this is intended or not but it caught me by surprise as this is different behaviour when compared to the standard cholesky! functionality from LinearAlgebra. I believe the reason for this behaviour can be found in the following line

https://github.com/JuliaArrays/StaticArrays.jl/blob/609aa343a0504c3f5bae82a6236c563a0fa72681/src/cholesky.jl#L11

which can be seen to return a new data.

MWE:

# Standard LinearAlgebra
S = Matrix(2.0I(3))
cholesky!(S)
S # S is changed

# StaticArrays
T = MMatrix{3,3,Float64,9}(2I(3))
cholesky!(T)
T # T has not changed

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 with src/cholesky.jl at line 11 and reproduce the MWE using an MMatrix alongside the standard LinearAlgebra case. Compare the mutation behavior and establish whether the StaticArrays implementation should leave the supplied MMatrix containing the factorization, then verify the corrected behavior with a focused test.

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
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.