Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ macro unsafe_strided(args...)

ex = Expr(:let, Expr(:block, [:($s = Strided.StridedView($s)) for s in syms]...), ex)
warnex = :(Base.depwarn("`@unsafe_strided A B C ... ex` is deprecated, use `@strided ex` instead.",
Core.Typeof(var"@unsafe_strided").name.mt.name))
Symbol("@unsafe_strided"); force=true))
return esc(Expr(:block, warnex, ex))
end

Expand Down
2 changes: 1 addition & 1 deletion src/mapreduce.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Methods based on map!
function Base.copyto!(dst::StridedView{<:Any,N}, src::StridedView{<:Any,N}) where {N}
function Base.copy!(dst::StridedView{<:Any,N}, src::StridedView{<:Any,N}) where {N}
return map!(identity, dst, src)
end
Base.conj!(a::StridedView{<:Real}) = a
Expand Down
26 changes: 13 additions & 13 deletions test/othertests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ end
@test minimum(real, R1) ≈ minimum(real, StridedView(R1))
@test sum(x -> real(x) < 0, R1) == sum(x -> real(x) < 0, StridedView(R1))

R1 = PermutedDimsArray(R1, (randperm(6)...,))
R2 = PermutedDimsArray(R1, (randperm(6)...,))

@test sum(R1) ≈ sum(StridedView(R1))
@test maximum(abs, R1) ≈ maximum(abs, StridedView(R1))
@test minimum(real, R1) ≈ minimum(real, StridedView(R1))
@test sum(x -> real(x) < 0, R1) == sum(x -> real(x) < 0, StridedView(R1))
@test sum(R2) ≈ sum(StridedView(R2))
@test maximum(abs, R2) ≈ maximum(abs, StridedView(R2))
@test minimum(real, R2) ≈ minimum(real, StridedView(R2))
@test sum(x -> real(x) < 0, R1) == sum(x -> real(x) < 0, StridedView(R2))

R2 = rand(T, (5, 5, 5))
@test prod(exp, StridedView(R2)) ≈ exp(sum(StridedView(R2)))
R3 = rand(T, (5, 5, 5))
@test prod(exp, StridedView(R3)) ≈ exp(sum(StridedView(R3)))
end
end

Expand Down Expand Up @@ -272,13 +272,13 @@ end
for op3 in (identity, conj, transpose, adjoint)
α = 2 + im
β = 3 - im
copyto!(B3, B4)
copy!(B3, B4)
mul!(op3(B3), op1(B1), op2(B2), α, β)
@test B3 ≈ op3(β) * A4 + op3(α * op1(A1) * op2(A2)) # op3 is its own inverse
copyto!(B3, B4)
copy!(B3, B4)
mul!(op3(B3), op1(B1), op2(B2), α, 0)
@test B3 ≈ op3(α * op1(A1) * op2(A2)) # op3 is its own inverse
copyto!(B3, B4)
copy!(B3, B4)
mul!(op3(B3), op1(B1), op2(B2))
@test B3 ≈ op3(op1(A1) * op2(A2)) # op3 is its own inverse
end
Expand Down Expand Up @@ -318,13 +318,13 @@ end
for op3 in (identity, conj, transpose, adjoint)
α = 1 // 2
β = 3 // 2
copyto!(B3, B4)
copy!(B3, B4)
mul!(op3(B3), op1(B1), op2(B2), α, β)
@test B3 ≈ op3(β) * A4 + op3(α * op1(A1) * op2(A2)) # op3 is its own inverse
copyto!(B3, B4)
copy!(B3, B4)
mul!(op3(B3), op1(B1), op2(B2), α, 1)
@test B3 ≈ A4 + op3(α * op1(A1) * op2(A2)) # op3 is its own inverse
copyto!(B3, B4)
copy!(B3, B4)
mul!(op3(B3), op1(B1), op2(B2), 1, 1)
@test B3 ≈ A4 + op3(op1(A1) * op2(A2)) # op3 is its own inverse
end
Expand Down
Loading