-
Notifications
You must be signed in to change notification settings - Fork 22
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
Bring conjugated_accessor and scaled_accessor in line with the C++ Working Draft #260
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
accessor_scaled::access now returns element_type, not a proxy reference type. The product is thus evaluated immediately on access.
* Rename accessor_conjugate to conjugate accessor * Don't use proxy reference machinery; instead, just make the "reference" a value * Add missing converting constructor
...into their own reusable header file. Move conj_if_needed, real_part, and imag_part tests out of proxy_refs.cpp into a new test file.
mhoemmen
changed the title
Implement scaled_accessor wording changes from LWG review
Implement scaled_accessor LWG review changes (& analogous conjugate_accessor changes)
Jul 26, 2023
...and test them.
This better reflects the header's contents. Also, fix the kokkos-kernels implementation, as it no longer needs the is_complex trait to determine if conj should be called on a number type.
scaled_accessor and conjugate_accessor no longer use proxy reference types, so we don't need to include that header in linalg any more. We still have a test for the proxy reference types, so move proxy_reference.hpp to the test directory.
mhoemmen
commented
Aug 2, 2023
mhoemmen
changed the title
Implement scaled_accessor LWG review changes (& analogous conjugate_accessor changes)
Bring conjugated_accessor and scaled_accessor in line with the C++ Working Draft
Sep 27, 2024
mhoemmen
force-pushed
the
remove-proxy-reference
branch
from
September 27, 2024 14:44
b4d69c1
to
d18fd5c
Compare
* Rename accessor_scaled to scaled_accessor, and accessor_conjugate to conjugated_accessor * Remove proxy references from both accessor types * Add missing conditional explicit to both accessors' constructors * Otherwise bring conjugated_accessor and scaled_accessor in line with the Standard * Fix namespaces where needed * Fix implementation of conj-if-needed, and add implementations (and tests) of real-if-needed and imag-if-needed * Add tests mixing result of scaled with an mdspan whose accessor uses a proxy reference as its reference type. This increases confidence that the proxy-reference-free design works.
mhoemmen
force-pushed
the
remove-proxy-reference
branch
from
September 27, 2024 14:57
d18fd5c
to
fffdc6f
Compare
crtrott
approved these changes
Sep 27, 2024
I counter checked with standard, and compiled and ran tests. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
accessor_scaled
toscaled_accessor
scaled_accessor::reference
to the actual product value, and changeelement_type
accordinglyscaled_accessor
's nested accessor could differ)scaled_accessor::access
conditionally (instead of unconditionally)noexcept
accessor_conjugate
toconjugate_accessor
conjugate_accessor
conj-if-needed
, and add implementations (and tests) ofreal-if-needed
andimag-if-needed
scaled
with an mdspan whose accessor uses a proxy reference as itsreference
type. This increases confidence that the new (proxy-reference-free) design works.