Support array eltypes in zeroeltype for Mul getindex - #280
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
dlfivefifty
added a commit
to JuliaApproximation/ClassicalOrthogonalPolynomials.jl
that referenced
this pull request
Sep 23, 2026
Requires FillArrays 1.17.1 (JuliaArrays/FillArrays.jl#452) and ArrayLayouts 1.12.4 (JuliaLinearAlgebra/ArrayLayouts.jl#280). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #280 +/- ##
===========================================
+ Coverage 0.00% 90.23% +90.23%
===========================================
Files 11 12 +1
Lines 1858 1966 +108
===========================================
+ Hits 0 1774 +1774
+ Misses 1858 192 -1666 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dlfivefifty
added a commit
to JuliaApproximation/ClassicalOrthogonalPolynomials.jl
that referenced
this pull request
Sep 24, 2026
* start supporting matrix/smatrix * Support sums of vector/matrix-valued expansions; remove local [sources] - sum_layout for SetindexInterlace expansions sums entrywise so Matrix entries work - interlace_setindex so Vector/Matrix z work (Base.setindex only supports immutable arrays) - test generator expand and matrix-valued sums, e.g. sum([exp(x) cos(x); sin(x) 1] for x in 0..1) - require QuasiArrays 0.13.13 for correct generator eltypes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Replace sum_layout overload with _sum(::SetindexInterlace, dims) Requires FillArrays 1.17.1 (JuliaArrays/FillArrays.jl#452) and ArrayLayouts 1.12.4 (JuliaLinearAlgebra/ArrayLayouts.jl#280). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <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.
Indexing a
Mul(_getindex) starts fromzeroeltype(M) = zero(eltype(M)). That fails when the entries are arrays without a type-levelzero, e.g.Vector{Float64}orMatrix{Float64}:For
Mulwith anAbstractArrayeltype, this PR takes the zero from the entries instead:zero(first(M.A) * first(M.B)). Other eltypes keepzero(eltype(M)), and existing specialisations ofzeroeltypeare unaffected.This came up with sums of matrix-valued expansions in ClassicalOrthogonalPolynomials.jl, e.g.
sum([exp(x) cos(x); sin(x) 1] for x in 0..1).🤖 Generated with Claude Code