Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare Cholesky and BunchKaufman by properties #54509

Merged
merged 5 commits into from
May 18, 2024

Conversation

jishnub
Copy link
Contributor

@jishnub jishnub commented May 17, 2024

The fields of a Factorization are more of an implementation detail, and a factorization is usually uniquely identified by its properties. Therefore, it makes sense to check if two Factorizaitons are equal by comparing their properties. I've implemented this for Cholesky and BunchKaufman, as these are the ones where the properties are wrappers around the field arrays, and therefore their values differ.

In particular, this would make such comparisons work even if the parents of the AbstractTriangular factors have uninitialized elements corresponding to the structural zeros of the triangular wrappers. Currently, this throws an error as it tries to compare the parents (which are the fields of the Factorization objects), but this is unnecessary. What really matters is that the triangular factors are equal.

This will make the comparisons slower in general, as new arrays may need to be allocated or computed. However, comparing two Factorization objects is probably unlikely to feature in a performance-sensitive path, and is perhaps more likely to feature in tests.

@dkarrasch dkarrasch merged commit df94a65 into master May 18, 2024
7 checks passed
@dkarrasch dkarrasch deleted the jishnub/factorizationpropertyequality branch May 18, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants