Fix ComplexF64 support in mul! and add interface tests#16
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
Fix ComplexF64 support in mul! and add interface tests#16ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
oscardssmith
approved these changes
Jan 7, 2026
Replace `fma` with `muladd` in two mul! methods to enable ComplexF64 support. The `fma` function is not defined for ComplexF64, causing runtime errors. The `muladd` function works with all numeric types including ComplexF64, BigFloat, Float32, and Int64. Changes: - src/SparseBandedMatrices.jl: Replace fma with muladd in mul!(Matrix, SparseBandedMatrix, Matrix) and mul!(Matrix, Matrix, SparseBandedMatrix) - test/interface.jl: Add interface compatibility tests for BigFloat, ComplexF64, Float32, and AbstractArray interface - test/runtests.jl: Include new interface tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1c64f05 to
3ac9e26
Compare
Author
|
Closing this PR as redundant. All changes from this PR (mul! fixes and interface tests) were already incorporated via PR #17. After rebasing, there are no unique changes left to merge. |
This file contains hidden or 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
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.
Summary
mul!to supportComplexF64by replacingfmawithmuladdProblem
The
fmafunction is not defined forComplexF64, causing runtime errors when usingmul!with complex matrices:This affected two
mul!methods:mul!(C::Matrix{T}, A::SparseBandedMatrix{T}, B::Matrix{T}, a::Number, b::Number)mul!(C::Matrix{T}, A::Matrix{T}, B::SparseBandedMatrix{T}, a::Number, b::Number)Solution
Replace
fmawithmuladdin the affected methods. Themuladdfunction works correctly with all numeric types:The other two
mul!methods already usedmuladd, so this change makes the implementation consistent.Tests Added
New interface tests in
test/interface.jlverify:Test Results
All 54 tests pass (27 new interface tests added).
cc @ChrisRackauckas
🤖 Generated with Claude Code