We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47ec78a commit 83c8385Copy full SHA for 83c8385
src/FillArrays.jl
@@ -4,7 +4,7 @@ using LinearAlgebra, SparseArrays
4
import Base: size, getindex, setindex!, IndexStyle, checkbounds, convert,
5
+, -, *, /, \, diff, sum, cumsum, maximum, minimum, sort, sort!,
6
any, all, axes, isone, iterate, unique, allunique, permutedims, inv,
7
- copy, vec, setindex!, count
+ copy, vec, setindex!, count, ==
8
9
import LinearAlgebra: rank, svdvals!, tril, triu, tril!, triu!, diag, transpose, adjoint, fill!,
10
norm2, norm1, normInf, normMinusInf, normp
@@ -17,6 +17,7 @@ export Zeros, Ones, Fill, Eye
17
18
abstract type AbstractFill{T, N, Axes} <: AbstractArray{T, N} end
19
20
+==(a::AbstractFill, b::AbstractFill) = axes(a) == axes(b) && getindex_value(a) == getindex_value(b)
21
22
@inline function getindex(F::AbstractFill, k::Integer)
23
@boundscheck checkbounds(F, k)
test/runtests.jl
@@ -286,6 +286,12 @@ end
286
end
287
288
289
+@testset "==" begin
290
+ @test Zeros(5,4) == Fill(0,5,4)
291
+ @test Zeros(5,4) ≠ Zeros(3)
292
+ @test Ones(5,4) == Fill(1,5,4)
293
+end
294
+
295
@testset "Rank" begin
296
@test rank(Zeros(5,4)) == 0
297
@test rank(Ones(5,4)) == 1
0 commit comments