Generalize exa_linalg to AbstractVector/AbstractMatrix#210
Merged
Generalize exa_linalg to AbstractVector/AbstractMatrix#210
Conversation
Replace concrete Vector/Matrix types with AbstractVector/AbstractMatrix
in all function signatures to support views, reshape, and other abstract
array types. This enables operations on SubArray, ReshapedArray, and
transposed arrays without creating copies.
Changes:
- Updated ~40 method signatures from Vector/Matrix to Abstract variants
- Added Union{Adjoint, Transpose} methods to resolve ambiguities
- Documented 56 detected ambiguities (24 theoretical, 32 with specialized
types like Diagonal/SparseVector that don't occur in practice)
- Added comprehensive test suite for AbstractArray compatibility
- Updated dimension mismatch tests to accept DimensionMismatch exception
All 439 tests pass. No breaking changes to existing functionality.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
This reverts commit da3f9c5.
All 431 tests now pass with no errors.
Implementation fixes:
- Added norm methods for AbstractVector/AbstractMatrix to support SubArray/ReshapedArray
- Added det method for AbstractMatrix to support ReshapedArray
- Added 12 scalar-array multiplication methods (Matrix/Vector × AbstractNode, both directions)
- Added type conversion methods: convert(Null{T}, Null{S}), convert(Real, Null)
- Changed Matrix × Vector to throw DimensionMismatch instead of AssertionError
Test fixes:
- Updated dimension mismatch tests to expect DimensionMismatch (not AssertionError)
- Fixed type checks: adjoint/transpose return wrapper types (AbstractMatrix, not Matrix)
- Fixed reshape type check to accept AbstractMatrix (Julia may simplify to Matrix)
Documentation:
- Added comprehensive guide on "6 Minimal Operations for Linear Algebra Extension"
- Documented scalar iteration protocol and why custom implementations optimize performance
- Clarified what works natively vs what needs custom optimization
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This reverts commit 8c39b06.
…Array Added support for array wrapper types while maintaining zero method ambiguities. Type aliases added: - Vec1DReal: Vector, SubArray, ReshapedArray, ReinterpretArray (Real only) - Vec1DNode: Vector, SubArray, ReshapedArray (AbstractNode, no ReinterpretArray) - Mat2D: Matrix, SubArray, ReshapedArray (2D arrays) - DenseSubArray/DenseReshapedArray: Restricted to DenseArray parents Key design decisions: - ReinterpretArray only for Real types (Complex→Real reinterpretation) - Restricted to DenseArray parents to avoid SparseArrays ambiguities - tr/det not defined for SubArray (unavoidable StridedMatrix ambiguity) - Users can collect/copy views first if needed for tr/det operations Updated 40+ method signatures across all linear algebra operations. Added 92 comprehensive tests covering all wrapper type combinations. Test results: - All 473 exa_linalg tests pass - Zero ambiguities in Aqua.test_ambiguities() Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Member
Author
|
Extend exa_linalg to support SubArray, ReshapedArray, and ReinterpretArray Type aliases added:
Key design decisions:
Updated 40+ method signatures across all linear algebra operations. Test results:
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com |
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.
Replace concrete Vector/Matrix types with AbstractVector/AbstractMatrix in all function signatures to support views, reshape, and other abstract array types. This enables operations on SubArray, ReshapedArray, and transposed arrays without creating copies.
Changes:
All 439 tests pass. No breaking changes to existing functionality.