Skip to content
Open
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
6 changes: 5 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e"
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
FixedSizeArrays = "3821ddf9-e5b5-40d5-8e25-6813ab96b5e2"
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Expand All @@ -38,6 +39,7 @@ ArrayInterfaceReverseDiffExt = "ReverseDiff"
ArrayInterfaceSparseArraysExt = "SparseArrays"
ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore"
ArrayInterfaceTrackerExt = "Tracker"
FixedSizeArraysExt = "FixedSizeArrays"

[compat]
AMDGPU = "2"
Expand All @@ -51,6 +53,7 @@ ChainRulesCore = "1"
ChainRulesTestUtils = "1"
ComponentArrays = "0.4.1 - 0"
FillArrays = "1"
FixedSizeArrays = "1"
GPUArraysCore = "0.1, 0.2"
JLArrays = "0.3"
LinearAlgebra = "1.10"
Expand All @@ -70,6 +73,7 @@ ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
FixedSizeArrays = "3821ddf9-e5b5-40d5-8e25-6813ab96b5e2"
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
Expand All @@ -86,4 +90,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"

[targets]
test = ["SafeTestsets", "Pkg", "Test", "Aqua", "Random", "SparseArrays", "SuiteSparse", "BandedMatrices", "BlockBandedMatrices", "GPUArraysCore", "JLArrays", "StaticArrays", "Tracker", "ReverseDiff", "ChainRules", "FillArrays", "ComponentArrays", "ChainRulesTestUtils"]
test = ["SafeTestsets", "Pkg", "Test", "Aqua", "Random", "SparseArrays", "SuiteSparse", "BandedMatrices", "BlockBandedMatrices", "GPUArraysCore", "JLArrays", "StaticArrays", "Tracker", "ReverseDiff", "ChainRules", "FillArrays", "FixedSizeArrays", "ComponentArrays", "ChainRulesTestUtils"]
15 changes: 15 additions & 0 deletions ext/FixedSizeArraysExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module FixedSizeArraysExt

using ArrayInterface: ArrayInterface
using FixedSizeArrays: FixedSizeMatrix
using LinearAlgebra: lu, qr

# Factorizing an empty matrix is cheap and yields exactly the factorization type
# of `A` (pivot vector types differ across eltypes, e.g. for BigFloat).
ArrayInterface.lu_instance(A::FixedSizeMatrix) = lu(similar(A, 0, 0), check = false)

function ArrayInterface.qr_instance(A::FixedSizeMatrix, pivot = ArrayInterface.DEFAULT_CHOLESKY_PIVOT)
return qr(similar(A, 0, 0), pivot)
end

end
17 changes: 17 additions & 0 deletions test/fixedsizearrays.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using ArrayInterface, FixedSizeArrays, LinearAlgebra, Test

@testset "$T" for T in (Float64, Float32, ComplexF64, Int, BigFloat)
F = FixedSizeMatrix{T}(T.(rand(1:5, 4, 4)) + 10I)

luF = ArrayInterface.lu_instance(F)
@test luF isa typeof(lu(F, check = false))
@test size(luF.factors) == (0, 0)

qrF = ArrayInterface.qr_instance(F)
@test qrF isa typeof(qr(F))
@test size(qrF.factors) == (0, 0)

qrpF = ArrayInterface.qr_instance(F, ColumnNorm())
@test qrpF isa typeof(qr(F, ColumnNorm()))
@test size(qrpF.factors) == (0, 0)
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ end
@time @safetestset "StaticArrays" begin include("staticarrays.jl") end
@time @safetestset "ChainRules" begin include("chainrules.jl") end
@time @safetestset "FillArrays" begin include("fillarrays.jl") end
@time @safetestset "FixedSizeArrays" begin include("fixedsizearrays.jl") end
end

if GROUP == "GPU"
Expand Down