diff --git a/Project.toml b/Project.toml index f729a83..fbf1532 100644 --- a/Project.toml +++ b/Project.toml @@ -1,10 +1,11 @@ name = "ArrayLayouts" uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" authors = ["Sheehan Olver "] -version = "1.11.1" +version = "1.11.2" [deps] FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b" +StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [weakdeps] @@ -33,8 +34,7 @@ Quaternions = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" -StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "Infinities", "Quaternions", "Random", "StableRNGs", "SparseArrays", "StaticArrays", "Test"] +test = ["Aqua", "Infinities", "Quaternions", "Random", "StableRNGs", "SparseArrays", "Test"] diff --git a/src/ArrayLayouts.jl b/src/ArrayLayouts.jl index 240c1fe..b4c69c9 100644 --- a/src/ArrayLayouts.jl +++ b/src/ArrayLayouts.jl @@ -24,6 +24,7 @@ using LinearAlgebra.BLAS: BlasComplex, BlasFloat, BlasReal const AdjointQtype{T} = isdefined(LinearAlgebra, :AdjointQ) ? LinearAlgebra.AdjointQ{T} : Adjoint{T,<:AbstractQ} using FillArrays: AbstractFill, axes_print_matrix_row, getindex_value +using StaticArrays using Base: require_one_based_indexing @@ -306,6 +307,8 @@ function zero!(_, A::AbstractArray{<:AbstractArray}) A end +zero!(_, A::AbstractArray{<:SArray}) = fill!(A,zero(eltype(A))) + _norm(_, A, p) = invoke(norm, Tuple{Any,Real}, A, p) LinearAlgebra.norm(A::LayoutArray, p::Real=2) = _norm(MemoryLayout(A), A, p) LinearAlgebra.norm(A::SubArray{<:Any,N,<:LayoutArray}, p::Real=2) where N = _norm(MemoryLayout(A), A, p) diff --git a/test/test_muladd.jl b/test/test_muladd.jl index 65df179..e578468 100644 --- a/test/test_muladd.jl +++ b/test/test_muladd.jl @@ -1,12 +1,12 @@ module TestMulAdd -using ArrayLayouts, FillArrays, Random, StableRNGs, LinearAlgebra, Test, Quaternions +using ArrayLayouts, FillArrays, Random, StableRNGs, LinearAlgebra, Test, Quaternions, StaticArrays using ArrayLayouts: DenseColumnMajor, AbstractStridedLayout, AbstractColumnMajor, DiagonalLayout, mul, Mul, zero! Random.seed!(0) @testset "Multiplication" begin @testset "zero!" begin - for A in (randn(5,5), [randn(5,5),randn(4,4)]) + for A in (randn(5,5), [randn(5,5),randn(4,4)], [SVector(2,3), SVector(3,4)]) zero!(A) @test iszero(A) end