Skip to content

Commit

Permalink
Merge pull request #56 from JuliaLang/roughly_vec
Browse files Browse the repository at this point in the history
don't use pointwise isapprox for rough array comparisons
  • Loading branch information
IainNZ committed Aug 25, 2015
2 parents 257e30e + f3a07ae commit 1355f41
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,11 @@ roughly(x::Number; kvtols...) = (y::Number) -> isapprox(y, x; kvtols...)

roughly(A::AbstractArray, atol) = (B::AbstractArray) -> begin
size(A) != size(B) && return false
for i in 1:length(A)
!isapprox(A[i], B[i], atol=atol) && return false
end
return true
return isapprox(A, B, atol=atol)
end
roughly(A::AbstractArray; kvtols...) = (B::AbstractArray) -> begin
size(A) != size(B) && return false
for i in 1:length(A)
!isapprox(A[i], B[i]; kvtols...) && return false
end
return true
return isapprox(A, B; kvtols...)
end

# anyof: match any of the arguments
Expand Down

0 comments on commit 1355f41

Please sign in to comment.