ArrayAllez.Array_Method
similar_(name, A)     ≈ similar(A)
Array_{T}(name, size) ≈ Array{T}(undef, size)

New arrays for intermediate results, drawn from an LRU cache when length(A) >= 2000. The cache's key uses name::Symbol as well as type & size to ensure different uses don't collide.

copy_(name, A) = copyto!(similar_(name, A), A)

Just like that.

ArrayAllez.copy_Method
similar_(name, A)     ≈ similar(A)
Array_{T}(name, size) ≈ Array{T}(undef, size)

New arrays for intermediate results, drawn from an LRU cache when length(A) >= 2000. The cache's key uses name::Symbol as well as type & size to ensure different uses don't collide.

copy_(name, A) = copyto!(similar_(name, A), A)

Just like that.

ArrayAllez.exp!Function
exp!(A)
exp_(A) = exp!(similar(A), A)
exp0(A) ≈ exp.(A)

Element-wise in-place exponential, and friends. Multi-threaded when length(A) >= 5000. Will be handled by Yeppp or AppleAccelerate or IntelVectorMath if you load one of them, note that Yeppp may well be slower.

ArrayAllez.exp_Method
exp!(A)
exp_(A) = exp!(similar(A), A)
exp0(A) ≈ exp.(A)

Element-wise in-place exponential, and friends. Multi-threaded when length(A) >= 5000. Will be handled by Yeppp or AppleAccelerate or IntelVectorMath if you load one of them, note that Yeppp may well be slower.

ArrayAllez.inv!Function
inv!(A) ≈ 1 ./ A
inv!(A, b::Number) ≈ b ./ A

And inv_(A) which copies, and inv0(A) simple broadcasting. Multi-threaded when length(A) >= 100000. Will be handled by AppleAccelerate if you load it.

ArrayAllez.inv_Function
inv!(A) ≈ 1 ./ A
inv!(A, b::Number) ≈ b ./ A

And inv_(A) which copies, and inv0(A) simple broadcasting. Multi-threaded when length(A) >= 100000. Will be handled by AppleAccelerate if you load it.

ArrayAllez.iscale!Function
iscale!(A, b::Number) ≈ A ./ b
iscale!(A, v::Vector) ≈ A ./ v      # A::Matrix
iscale!(A, r::Adjoint) ≈ A ./ r     # r::RowVector / Transpose etc.
iscale!(A, B) ≈ A ./ B

For each of these, there is also iscale_(A, ...) non-mutating but perhaps accellerated, and iscale0(A, ...) simple broadcasting. Finally there is iscale!!(A, x) which mutate both arguments, wihch may be a terrible idea.

ArrayAllez.iscale_Method
iscale!(A, b::Number) ≈ A ./ b
iscale!(A, v::Vector) ≈ A ./ v      # A::Matrix
iscale!(A, r::Adjoint) ≈ A ./ r     # r::RowVector / Transpose etc.
iscale!(A, B) ≈ A ./ B

For each of these, there is also iscale_(A, ...) non-mutating but perhaps accellerated, and iscale0(A, ...) simple broadcasting. Finally there is iscale!!(A, x) which mutate both arguments, wihch may be a terrible idea.

ArrayAllez.log!Function
log!(A)
log_(A) ≈ log!(similar(A), A)
log0(A) = log.(A)

Element-wise in-place natural logarithm, and friends. Multi-threaded when length(A) >= 5000. Will be handled by Yeppp or AppleAccelerate or IntelVectorMath if you load one of them.

ArrayAllez.log_Method
log!(A)
log_(A) ≈ log!(similar(A), A)
log0(A) = log.(A)

Element-wise in-place natural logarithm, and friends. Multi-threaded when length(A) >= 5000. Will be handled by Yeppp or AppleAccelerate or IntelVectorMath if you load one of them.

ArrayAllez.scale!Function
scale!(A, b::Number) ≈ A .* b
scale!(M, v::Vector) ≈ A .* v       # M::Matrix
scale!(M, r::Adjoint) ≈ A .* r      # r::RowVector / Transpose etc.
scale!(A, B) ≈ A .* B               # A,B same ndims

In-place scaling by a constant or (in the case of a matrix) by a row- or column-vector. For each of these, there is also also scale_(A, ...) non-mutating but perhaps accellerated, and scale0(A, ...) simple broadcasting.

ArrayAllez.scale_Method
scale!(A, b::Number) ≈ A .* b
scale!(M, v::Vector) ≈ A .* v       # M::Matrix
scale!(M, r::Adjoint) ≈ A .* r      # r::RowVector / Transpose etc.
scale!(A, B) ≈ A .* B               # A,B same ndims

In-place scaling by a constant or (in the case of a matrix) by a row- or column-vector. For each of these, there is also also scale_(A, ...) non-mutating but perhaps accellerated, and scale0(A, ...) simple broadcasting.

ArrayAllez.similar_Method
similar_(name, A)     ≈ similar(A)
Array_{T}(name, size) ≈ Array{T}(undef, size)

New arrays for intermediate results, drawn from an LRU cache when length(A) >= 2000. The cache's key uses name::Symbol as well as type & size to ensure different uses don't collide.

copy_(name, A) = copyto!(similar_(name, A), A)

Just like that.

ArrayAllez.@dropdimsMacro
@dropdims sum(A; dims=1)

Macro which wraps such reductions in dropdims(...; dims=1). Allows sum(A; dims=1) do x stuff end, and works on whole blocks of code like @views. Does not handle other keywords, like reduce(...; dims=..., init=...).

ArrayAllez.@threadsMacro

This is the replacement for Julia's @threads macro proposed in https://github.com/JuliaLang/julia/pull/35003