Skip to content

Equality/hash edge cases for QRCompactWY#1582

Open
jishnub wants to merge 2 commits into
masterfrom
jishnub/qr_hash
Open

Equality/hash edge cases for QRCompactWY#1582
jishnub wants to merge 2 commits into
masterfrom
jishnub/qr_hash

Conversation

@jishnub

@jishnub jishnub commented Apr 27, 2026

Copy link
Copy Markdown
Member

This ensures the we don't accidentally end up with cases where two objects are equal but their hashes differ, or we divide by zero if the matrices are empty.

Co-authored-by: Copilot copilot@github.com

jishnub and others added 2 commits April 27, 2026 17:12
Co-authored-by: Copilot <copilot@github.com>
Comment thread test/qr.jl
@testset "QRCompactWY equality checks T shape" begin
# This is a contrived example, but ensures that we don't violate the hash contract
F = LinearAlgebra.QRCompactWY(zeros(1, 1), reshape([1.0], 1, 1))
G = LinearAlgebra.QRCompactWY(zeros(1, 1), reshape([1.0 99.0], 1, 2))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is G even valid, though? Shouldn't the constructor just throw an error?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it should

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants