|
226 | 226 | end |
227 | 227 |
|
228 | 228 | @testset "mul! + Diagonal" begin |
229 | | - for elty in (Float32, ComplexF32) |
| 229 | + @testset "$elty" for elty in (Float32, ComplexF32) |
230 | 230 | n = 128 |
231 | 231 | d = AT(rand(elty, n)) |
232 | 232 | D = Diagonal(d) |
|
303 | 303 | end |
304 | 304 | end |
305 | 305 |
|
306 | | - @testset "lmul! and rmul!" for (a,b) in [((3,4),(4,3)), ((3,), (1,3)), ((1,3), (3))], T in eltypes |
307 | | - @test compare(rmul!, AT, rand(T, a), Ref(rand(T))) |
308 | | - @test compare(lmul!, AT, Ref(rand(T)), rand(T, b)) |
| 306 | + @testset "lmul! and rmul!" begin |
| 307 | + @testset "$T ($a,$b)" for (a,b) in [((3,4),(4,3)), ((3,), (1,3)), ((1,3), (3))], T in eltypes |
| 308 | + @test compare(rmul!, AT, rand(T, a), Ref(rand(T))) |
| 309 | + @test compare(lmul!, AT, Ref(rand(T)), rand(T, b)) |
| 310 | + end |
309 | 311 | end |
310 | 312 |
|
311 | | - @testset "axp{b}y" for T in eltypes |
312 | | - @test compare(axpby!, AT, Ref(rand(T)), rand(T,5), Ref(rand(T)), rand(T,5)) |
313 | | - @test compare(axpy!, AT, Ref(rand(T)), rand(T,5), rand(T,5)) |
| 313 | + @testset "axp{b}y" begin |
| 314 | + @testset "$T" for T in eltypes |
| 315 | + @test compare(axpby!, AT, Ref(rand(T)), rand(T,5), Ref(rand(T)), rand(T,5)) |
| 316 | + @test compare(axpy!, AT, Ref(rand(T)), rand(T,5), rand(T,5)) |
| 317 | + end |
314 | 318 | end |
315 | 319 |
|
316 | | - @testset "dot" for T in eltypes |
317 | | - @test compare(dot, AT, rand(T,5), rand(T, 5)) |
| 320 | + @testset "dot" begin |
| 321 | + @testset "$T" for T in eltypes |
| 322 | + @test compare(dot, AT, rand(T,5), rand(T, 5)) |
| 323 | + end |
318 | 324 | end |
319 | 325 |
|
320 | | - @testset "rotate!" for T in eltypes |
321 | | - @test compare(rotate!, AT, rand(T,5), rand(T,5), Ref(rand(real(T))), Ref(rand(T))) |
| 326 | + @testset "rotate!" begin |
| 327 | + @testset "$T" for T in eltypes |
| 328 | + @test compare(rotate!, AT, rand(T,5), rand(T,5), Ref(rand(real(T))), Ref(rand(T))) |
| 329 | + end |
322 | 330 | end |
323 | 331 |
|
324 | | - @testset "reflect!" for T in eltypes |
325 | | - @test compare(reflect!, AT, rand(T,5), rand(T,5), Ref(rand(real(T))), Ref(rand(T))) |
| 332 | + @testset "reflect!" begin |
| 333 | + @testset "$T" for T in eltypes |
| 334 | + @test compare(reflect!, AT, rand(T,5), rand(T,5), Ref(rand(real(T))), Ref(rand(T))) |
| 335 | + end |
326 | 336 | end |
327 | 337 |
|
328 | | - @testset "iszero and isone" for T in eltypes |
329 | | - A = one(AT(rand(T, 2, 2))) |
330 | | - @test isone(A) |
331 | | - @test iszero(A) == false |
| 338 | + @testset "iszero and isone" begin |
| 339 | + @testset "$T" for T in eltypes |
| 340 | + A = one(AT(rand(T, 2, 2))) |
| 341 | + @test isone(A) |
| 342 | + @test iszero(A) == false |
332 | 343 |
|
333 | | - A = zero(AT(rand(T, 2, 2))) |
334 | | - @test iszero(A) |
335 | | - @test isone(A) == false |
| 344 | + A = zero(AT(rand(T, 2, 2))) |
| 345 | + @test iszero(A) |
| 346 | + @test isone(A) == false |
| 347 | + end |
336 | 348 | end |
337 | 349 |
|
338 | 350 | @testset "kron" begin |
339 | | - @testset "$T" for T in eltypes |
340 | | - for opa in (vec, identity, transpose, adjoint), opb in (vec, identity, transpose, adjoint) |
341 | | - @test compare(kron, AT, opa(rand(T, 32, 64)), opb(rand(T, 128, 16))) |
342 | | - end |
| 351 | + @testset "$T, $opa, $opb" for T in eltypes, opa in (vec, identity, transpose, adjoint), opb in (vec, identity, transpose, adjoint) |
| 352 | + @test compare(kron, AT, opa(rand(T, 32, 64)), opb(rand(T, 128, 16))) |
343 | 353 | end |
344 | 354 | end |
345 | 355 | end |
|
0 commit comments