Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,25 @@ jobs:
test:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- 'min'
- 'lts'
- '1'
- 'pre'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
Expand Down
17 changes: 7 additions & 10 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name = "FillArrays"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "1.14.0"
version = "1.15.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[weakdeps]
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
Expand All @@ -22,16 +19,16 @@ FillArraysStatisticsExt = "Statistics"
Aqua = "0.8"
Documenter = "1"
Infinities = "0.1"
LinearAlgebra = "1.6"
LinearAlgebra = "1"
PDMats = "0.11.17"
Quaternions = "0.7"
Random = "1.6"
Random = "1"
ReverseDiff = "1"
SparseArrays = "1.6"
SparseArrays = "1"
StaticArrays = "1"
Statistics = "1.6"
Test = "1.6"
julia = "1.6"
Statistics = "1"
Test = "1"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Expand Down
7 changes: 1 addition & 6 deletions ext/FillArraysSparseArraysExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ end
@deprecate kron(E1::RectDiagonalFill, E2::RectDiagonalFill) kron(sparse(E1), sparse(E2))

# Ambiguity. see #178
if VERSION >= v"1.8"
dot(x::AbstractFillVector, y::SparseVectorUnion) = _fill_dot(x, y)
else
dot(x::AbstractFillVector{<:Number}, y::SparseVectorUnion{<:Number}) = _fill_dot(x, y)
end

dot(x::AbstractFillVector, y::SparseVectorUnion) = _fill_dot(x, y)

end # module
26 changes: 3 additions & 23 deletions src/FillArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,10 @@ ishermitian(F::AbstractFillMatrix) = axes(F,1) == axes(F,2) && (isempty(F) || is
Base.IteratorSize(::Type{<:AbstractFill{T,N,Axes}}) where {T,N,Axes} = _IteratorSize(Axes)
_IteratorSize(::Type{Tuple{}}) = Base.HasShape{0}()
_IteratorSize(::Type{Tuple{T}}) where {T} = Base.IteratorSize(T)
# Julia Base has an optimized any for Tuples on versions >= v1.9
# On lower versions, a recursive implementation helps with type-inference
if VERSION >= v"1.9.0-beta3"
_any(f, t::Tuple) = any(f, t)
else
_any(f, ::Tuple{}) = false
_any(f, t::Tuple) = f(t[1]) || _any(f, Base.tail(t))
end
function _IteratorSize(::Type{T}) where {T<:Tuple}
N = fieldcount(T)
s = ntuple(i-> Base.IteratorSize(fieldtype(T, i)), N)
_any(x -> x isa Base.IsInfinite, s) ? Base.IsInfinite() : Base.HasShape{N}()
any(x -> x isa Base.IsInfinite, s) ? Base.IsInfinite() : Base.HasShape{N}()
end


Expand Down Expand Up @@ -738,12 +730,6 @@ include("fillalgebra.jl")
include("fillbroadcast.jl")
include("trues.jl")

if !isdefined(Base, :get_extension)
include("../ext/FillArraysPDMatsExt.jl")
include("../ext/FillArraysSparseArraysExt.jl")
include("../ext/FillArraysStatisticsExt.jl")
end

##
# print
##
Expand All @@ -752,15 +738,9 @@ Base.replace_in_print_matrix(::AbstractZeros, ::Integer, ::Integer, s::AbstractS

# following support blocked fill array printing via
# BlockArrays.jl
if VERSION < v"1.8-"
axes_print_matrix_row(lay, io, X, A, i, cols, sep) =
Base.invoke(Base.print_matrix_row, Tuple{IO,AbstractVecOrMat,Vector,Integer,AbstractVector,AbstractString},
io, X, A, i, cols, sep)
else
axes_print_matrix_row(lay, io, X, A, i, cols, sep, idxlast::Integer=last(axes(X, 2))) =
Base.invoke(Base.print_matrix_row, Tuple{IO,AbstractVecOrMat,Vector,Integer,AbstractVector,AbstractString,Integer},
axes_print_matrix_row(lay, io, X, A, i, cols, sep, idxlast::Integer=last(axes(X, 2))) =
Base.invoke(Base.print_matrix_row, Tuple{IO,AbstractVecOrMat,Vector,Integer,AbstractVector,AbstractString,Integer},
io, X, A, i, cols, sep, idxlast)
end

Base.print_matrix_row(io::IO,
X::Union{AbstractFillVector,
Expand Down
33 changes: 9 additions & 24 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,12 @@ function test_addition_subtraction_dot(As, Bs, Tout::Type)
@test @inferred(B - A) isa Tout{promote_type(eltype(B), eltype(A))}
@test isapprox_or_undef(as_array(B - A), as_array(B) - as_array(A))

# Julia 1.6 doesn't support dot(UniformScaling)
if VERSION < v"1.6.0" || VERSION >= v"1.8.0"
d1 = dot(A, B)
d2 = dot(as_array(A), as_array(B))
d3 = dot(B, A)
d4 = dot(as_array(B), as_array(A))
@test d1 ≈ d2 || d1 ≡ d2
@test d3 ≈ d4 || d3 ≡ d4
end
d1 = dot(A, B)
d2 = dot(as_array(A), as_array(B))
d3 = dot(B, A)
d4 = dot(as_array(B), as_array(A))
@test d1 ≈ d2 || d1 ≡ d2
@test d3 ≈ d4 || d3 ≡ d4
end
end
end
Expand Down Expand Up @@ -1930,9 +1927,7 @@ end
E = Eye(2)
K = kron(E, E)
@test K isa Diagonal
if VERSION >= v"1.9"
@test K isa typeof(E)
end
@test K isa typeof(E)
C = collect(E)
@test K == kron(C, C)

Expand Down Expand Up @@ -2789,11 +2784,7 @@ end
)
O = OneElement(v,ind,sz)
A = Array(O)
if VERSION >= v"1.10"
@test @inferred(sum(O)) === sum(A)
else
@test @inferred(sum(O)) == sum(A)
end
@test @inferred(sum(O)) === sum(A)
@test @inferred(sum(O, init=zero(eltype(O)))) === sum(A, init=zero(eltype(O)))
@test @inferred(sum(x->1, O, init=0)) === sum(Fill(1, axes(O)), init=0)
end
Expand Down Expand Up @@ -2948,13 +2939,7 @@ end
end

@testset "structured matrix" begin
# strange bug on Julia v1.6, see
# https://discourse.julialang.org/t/strange-seemingly-out-of-bounds-access-bug-in-julia-v1-6/101041
bands = if VERSION >= v"1.9"
((Fill(2,3), Fill(6,2)), (Zeros(3), Zeros(2)))
else
((Fill(2,3), Fill(6,2)),)
end
bands = ((Fill(2,3), Fill(6,2)), (Zeros(3), Zeros(2)))
@testset for (dv, ev) in bands
for D in (Diagonal(dv), Bidiagonal(dv, ev, :U),
Tridiagonal(ev, dv, ev), SymTridiagonal(dv, ev))
Expand Down
Loading