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

Implement P3371 #293

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Implement P3371 #293

wants to merge 11 commits into from

Conversation

mhoemmen
Copy link
Contributor

@mhoemmen mhoemmen commented Oct 4, 2024

  • matrix_rank_1_update
  • matrix_rank_1_update_c
  • symmetric_matrix_rank_1_update
  • hermitian_matrix_rank_1_update
  • symmetric_matrix_rank_2_update
  • hermitian_matrix_rank_2_update
  • symmetric_matrix_rank_k_update
  • hermitian_matrix_rank_k_update
  • symmetric_matrix_rank_2k_update
  • hermitian_matrix_rank_2k_update

mhoemmen and others added 9 commits October 1, 2024 16:09
This is for the implementation of P3371.  It's OFF by default.

Nothing currently uses the macro.
Change existing hermitian_matrix_rank_1_update overloads
to be overwriting instead of unconditionally updating,
and add updating hermitian_matrix_rank_1_update overloads.

Guard changes with the appropriate macro, which by default
is NOT defined.

Add lots of tests to ensure coverage of all cases.
Tests pass whether or not P3371 support is enabled.
Change existing symmetric_matrix_rank_1_update overloads
to be overwriting instead of unconditionally updating,
and add updating symmetric_matrix_rank_1_update overloads.

Guard changes with the appropriate macro, which by default
is NOT defined.

Add lots of tests to ensure coverage of all cases.
Tests pass whether or not P3371 support is enabled.
One could imagine 3 ways to make sure alpha is real:

1. constrain alpha to be a noncomplex number type,

2. impose a precondition that alpha has zero imaginary part, or

3. set alpha to _`real-if-needed`_`(alpha)`.

This commit implements Option (3).  This has the advantage of
working just like how linalg makes the diagonal real.
The function wasn't tested before.

If the option to enable P3371's changes is enabled,
the new tests don't build.
Change existing matrix_rank_1_update overloads
to be overwriting instead of unconditionally updating,
and add updating matrix_rank_1_update overloads.

Guard changes with the appropriate macro, which by default
is NOT defined.

Add lots of tests to ensure coverage of all cases.
Tests pass whether or not P3371 support is enabled.
Change existing matrix_rank_1_update_c overloads
to be overwriting instead of unconditionally updating,
and add updating matrix_rank_1_update_c overloads.

Guard changes with the appropriate macro, which by default
is NOT defined.

Add lots of tests to ensure coverage of all cases.
Tests pass whether or not P3371 support is enabled.
@mhoemmen mhoemmen marked this pull request as ready for review October 28, 2024 22:25
@iburyl
Copy link
Contributor

iburyl commented Oct 28, 2024

no LINALG_FIX_RANK_UPDATES was used in rank_k updates

@iburyl
Copy link
Contributor

iburyl commented Oct 30, 2024

Looked through rank_1 implementations - looks ok
(managing triangles / diagonals with almost same formulas is implemented inconsistently, but correctly - nothing to be too conserned too much)

@mhoemmen
Copy link
Contributor Author

(managing triangles / diagonals with almost same formulas is implemented inconsistently, but correctly - nothing to be too concerned too much)

That's totally on me -- I was prioritizing "passes the tests" over "code makes sense" ; - ) .

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