We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1bd114a + 10723ba commit 1f7b7f9Copy full SHA for 1f7b7f9
lib/ArrayInterfaceCore/src/ArrayInterfaceCore.jl
@@ -526,7 +526,9 @@ returns the matrix linear operator type which acts on the `vec` of the array.
526
function undefmatrix(u)
527
similar(u, length(u), length(u))
528
end
529
-
+function undefmatrix(u::Number)
530
+ return zero(u)
531
+end
532
"""
533
restructure(x,y)
534
lib/ArrayInterfaceCore/test/runtests.jl
@@ -25,6 +25,8 @@ Aqua.test_all(ArrayInterfaceCore)
25
@test size(um) == (length(v),length(v))
26
@test typeof(um) == Matrix{T}
27
@test zeromatrix(v) == zeros(T,4*4*4,4*4*4)
28
+ @test zeromatrix(rand(T)) == zero(T)
29
+ @test undefmatrix(rand(T)) isa T
30
31
32
0 commit comments