JuliaLinearAlgebra / BlockBandedMatrices.jl

A Julia package for representing block-banded matrices and banded-block-banded matrices
https://julialinearalgebra.github.io/BlockBandedMatrices.jl/
MIT License
56 stars 13 forks source link

Update result type in triangular-vector multiplication #185

Closed jishnub closed 6 months ago

jishnub commented 6 months ago

Since this package owns neither AbstractTriangular nor Vector, and doesn't specialize their product either, we can't be certain that the type of AbstractTriangular * Vector does not change. This is, in fact, the case on v1.11, where

julia> A = BandedBlockBandedMatrix{Float64}(undef, 1:2,1:2, (1,1), (1,1));

julia> A.data .= randn.();

julia> U = UpperTriangular(A);

julia> b = randn(size(U,2));

julia> U * b
2-blocked 3-element BlockArrays.PseudoBlockVector{Float64, Vector{Float64}, Tuple{BlockArrays.BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}}}:
 -1.5655580183462696  
 ─────────────────────
  1.9596298000456944  
 -0.037451137182675044

This used to return a Vector on older versions. The change arises from the fact that an AbstractTriangular matrix preserves the axes of the parent.

This PR changes the explicit test for a Vector to that for an AbstractVector

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.12%. Comparing base (4ad9b38) to head (0ac0bdb).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #185 +/- ## ======================================= Coverage 88.12% 88.12% ======================================= Files 11 11 Lines 1204 1204 ======================================= Hits 1061 1061 Misses 143 143 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.