Skip to content

Commit b6fff8c

Browse files
upstream test with zeromatrix overloads
1 parent 1bd8882 commit b6fff8c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1515
ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"
1616

1717
[compat]
18-
ArrayInterface = "1.2, 2.0"
18+
ArrayInterface = "2.7"
1919
RecipesBase = "0.7, 0.8, 1.0"
2020
Requires = "0.5, 1.0"
2121
StaticArrays = "0.10, 0.11, 0.12"
2222
ZygoteRules = "0.2"
23-
julia = "1"
23+
julia = "1.3"
2424

2525
[extras]
2626
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/array_partition.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ common_number(a, b) =
296296

297297
## Linear Algebra
298298

299+
ArrayInterface.zeromatrix(A::ArrayPartition) = ArrayInterface.zeromatrix(reduce(vcat,vec.(A.x)))
299300
LinearAlgebra.ldiv!(A::LinearAlgebra.LU,b::ArrayPartition) = ldiv!(A,Array(b))
300301
LinearAlgebra.ldiv!(A::LinearAlgebra.QR,b::ArrayPartition) = ldiv!(A,Array(b))
301302
LinearAlgebra.ldiv!(A::LinearAlgebra.SVD,b::ArrayPartition) = ldiv!(A,Array(b))

test/upstream.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using OrdinaryDiffEq, NLsolve, RecursiveArrayTools, Test
1+
using OrdinaryDiffEq, NLsolve, RecursiveArrayTools, Test, ArrayInterface
22
function lorenz(du,u,p,t)
33
du[1] = 10.0*(u[2]-u[1])
44
du[2] = u[1]*(28.0-u[3]) - u[2]
55
du[3] = u[1]*u[2] - (8/3)*u[3]
66
end
77
u0 = ArrayPartition([1.0,0.0],[0.0])
8-
@test u0 .* u0' .* false isa Matrix
8+
@test ArrayInterface.zeromatrix(u0) isa Matrix
99
tspan = (0.0,100.0)
1010
prob = ODEProblem(lorenz,u0,tspan)
1111
sol = solve(prob,Tsit5());

0 commit comments

Comments
 (0)