@@ -323,17 +323,25 @@ import Base.LinAlg: fillslots!, UnitLowerTriangular
323323 Bidiagonal (randn (3 ), randn (2 ), rand ([:U ,:L ])),
324324 SymTridiagonal (randn (3 ), randn (2 )),
325325 sparse (randn (3 ,4 )),
326- Diagonal (randn (5 )),
326+ # Diagonal(randn(5)), # Diagonal fill! deprecated, see below
327327 sparse (rand (3 )),
328- LowerTriangular (randn (3 ,3 )),
329- UpperTriangular (randn (3 ,3 ))
328+ # LowerTriangular(randn(3,3)), # AbstractTriangular fill! deprecated, see below
329+ # UpperTriangular(randn(3,3)) # AbstractTriangular fill! deprecated, see below
330330 ]
331331 for A in exotic_arrays
332332 fill! (A, 0 )
333333 for a in A
334334 @test a == 0
335335 end
336336 end
337+ # Diagonal and AbstractTriangular fill! were defined as fillslots!,
338+ # not matching the general behavior of fill!, and so have been deprecated.
339+ # In a future dev cycle, these fill! methods should probably be reintroduced
340+ # with behavior matching that of fill! for other structured matrix types.
341+ # In the interm, equivalently test fillslots! below
342+ @test iszero (fillslots! (Diagonal (fill (1 , 3 )), 0 ))
343+ @test iszero (fillslots! (LowerTriangular (fill (1 , 3 , 3 )), 0 ))
344+ @test iszero (fillslots! (UpperTriangular (fill (1 , 3 , 3 )), 0 ))
337345 end
338346 let # fill!(small, x)
339347 val = randn ()
0 commit comments