Skip to content

Preserve components in complex-like conversions - #4199

Closed
PhysicistJohn wants to merge 1 commit into
ml-explore:mainfrom
PhysicistJohn:fix-complex-like-conversions
Closed

Preserve components in complex-like conversions#4199
PhysicistJohn wants to merge 1 commit into
ml-explore:mainfrom
PhysicistJohn:fix-complex-like-conversions

Conversation

@PhysicistJohn

Copy link
Copy Markdown
Contributor

Proposed changes

Complex-like inputs that also expose a scalar conversion currently select the scalar constructor, replacing their real component with the scalar value and dropping the imaginary component. Construct those inputs from real() and imag() instead, keep scalar and complex-like constructor paths mutually exclusive, and reject complex-like inputs whose components cannot be converted. Existing conversion traits and wrapper layout remain unchanged.

The focused regression passes 12/12 assertions. The full native suite passes 249/249 tests with 3,354 assertions, and CTest passes 250/250.

Checklist

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

@zcbenz

zcbenz commented Aug 12, 2026

Copy link
Copy Markdown
Member

requires requires C++20 which we don't want to enforce for JIT compilation yet, and while it is nice to support complex like structures I think it is not worthwhile at the moment.

@zcbenz zcbenz closed this Aug 12, 2026
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