diff --git a/src/array_interface.jl b/src/array_interface.jl index 0c2012d9..087dafed 100644 --- a/src/array_interface.jl +++ b/src/array_interface.jl @@ -2,6 +2,16 @@ Base.parent(x::ComponentArray) = getfield(x, :data) Base.size(x::ComponentArray) = size(getdata(x)) ArrayInterface.size(A::ComponentArray) = ArrayInterface.size(parent(A)) + +## https://github.com/SciML/DifferentialEquations.jl/issues/849 +function ArrayInterface.lu_instance(x::ComponentMatrix) + T = eltype(x) + noUnitT = typeof(zero(T)) + luT = LinearAlgebra.lutype(noUnitT) + ipiv = Vector{LinearAlgebra.BlasInt}(undef, 0) + info = zero(LinearAlgebra.BlasInt) + return LU{luT}(similar(x), ipiv, info) +end Base.elsize(x::Type{<:ComponentArray{T,N,A,Axes}}) where {T,N,A,Axes} = Base.elsize(A) @@ -246,4 +256,4 @@ end # Base.$f(x::Adjoint{T,<:AbstractVector{T}}, y::ComponentVector{T,A,Axes}) where {T<:Real,A,Axes} = $f(getdata(x), getdata(y)) # Base.$f(x::Transpose{T,<:AbstractVector{T}}, y::ComponentVector{T,A,Axes}) where {T<:Real,A,Axes} = $f(getdata(x), getdata(y)) # end -# end \ No newline at end of file +# end