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