|
1 | 1 | # This file is a part of Julia. License is MIT: https://julialang.org/license
|
2 | 2 |
|
| 3 | +using Base.LinAlg: mul!, ldiv!, rdiv!, Adjoint, Transpose |
| 4 | + |
3 | 5 | @testset "issparse" begin
|
4 | 6 | @test issparse(sparse(ones(5,5)))
|
5 | 7 | @test !issparse(ones(5,5))
|
@@ -191,10 +193,10 @@ end
|
191 | 193 | α = rand(Complex128)
|
192 | 194 | β = rand(Complex128)
|
193 | 195 | @test (maximum(abs.(a*b - Array(a)*b)) < 100*eps())
|
194 |
| - @test (maximum(abs.(A_mul_B!(similar(b), a, b) - Array(a)*b)) < 100*eps()) # for compatibility with present matmul API. Should go away eventually. |
195 |
| - @test (maximum(abs.(A_mul_B!(similar(c), a, c) - Array(a)*c)) < 100*eps()) # for compatibility with present matmul API. Should go away eventually. |
196 |
| - @test (maximum(abs.(At_mul_B!(similar(b), a, b) - Array(a).'*b)) < 100*eps()) # for compatibility with present matmul API. Should go away eventually. |
197 |
| - @test (maximum(abs.(At_mul_B!(similar(c), a, c) - Array(a).'*c)) < 100*eps()) # for compatibility with present matmul API. Should go away eventually. |
| 196 | + @test (maximum(abs.(mul!(similar(b), a, b) - Array(a)*b)) < 100*eps()) # for compatibility with present matmul API. Should go away eventually. |
| 197 | + @test (maximum(abs.(mul!(similar(c), a, c) - Array(a)*c)) < 100*eps()) # for compatibility with present matmul API. Should go away eventually. |
| 198 | + @test (maximum(abs.(mul!(similar(b), Transpose(a), b) - Array(a).'*b)) < 100*eps()) # for compatibility with present matmul API. Should go away eventually. |
| 199 | + @test (maximum(abs.(mul!(similar(c), Transpose(a), c) - Array(a).'*c)) < 100*eps()) # for compatibility with present matmul API. Should go away eventually. |
198 | 200 | @test (maximum(abs.(a'b - Array(a)'b)) < 100*eps())
|
199 | 201 | @test (maximum(abs.(a.'b - Array(a).'b)) < 100*eps())
|
200 | 202 | @test (maximum(abs.(a\b - Array(a)\b)) < 1000*eps())
|
@@ -340,11 +342,11 @@ dA = Array(sA)
|
340 | 342 | bi = inv.(b)
|
341 | 343 | dAt = transpose(dA)
|
342 | 344 | sAt = transpose(sA)
|
343 |
| - @test scale!(copy(dAt), bi) ≈ Base.LinAlg.A_rdiv_B!(copy(sAt), Diagonal(b)) |
344 |
| - @test scale!(copy(dAt), bi) ≈ Base.LinAlg.A_rdiv_Bt!(copy(sAt), Diagonal(b)) |
345 |
| - @test scale!(copy(dAt), conj(bi)) ≈ Base.LinAlg.A_rdiv_Bc!(copy(sAt), Diagonal(b)) |
346 |
| - @test_throws DimensionMismatch Base.LinAlg.A_rdiv_B!(copy(sAt), Diagonal(ones(length(b) + 1))) |
347 |
| - @test_throws LinAlg.SingularException Base.LinAlg.A_rdiv_B!(copy(sAt), Diagonal(zeros(length(b)))) |
| 345 | + @test scale!(copy(dAt), bi) ≈ rdiv!(copy(sAt), Diagonal(b)) |
| 346 | + @test scale!(copy(dAt), bi) ≈ rdiv!(copy(sAt), Transpose(Diagonal(b))) |
| 347 | + @test scale!(copy(dAt), conj(bi)) ≈ rdiv!(copy(sAt), Adjoint(Diagonal(b))) |
| 348 | + @test_throws DimensionMismatch rdiv!(copy(sAt), Diagonal(ones(length(b) + 1))) |
| 349 | + @test_throws LinAlg.SingularException rdiv!(copy(sAt), Diagonal(zeros(length(b)))) |
348 | 350 | end
|
349 | 351 | end
|
350 | 352 |
|
@@ -1842,7 +1844,7 @@ end
|
1842 | 1844 | m = 5
|
1843 | 1845 | intmat = fill(1, m, m)
|
1844 | 1846 | ltintmat = LowerTriangular(rand(1:5, m, m))
|
1845 |
| - @test At_ldiv_B(ltintmat, sparse(intmat)) ≈ At_ldiv_B(ltintmat, intmat) |
| 1847 | + @test \(Transpose(ltintmat), sparse(intmat)) ≈ \(Transpose(ltintmat), intmat) |
1846 | 1848 | end
|
1847 | 1849 |
|
1848 | 1850 | # Test temporary fix for issue #16548 in PR #16979. Somewhat brittle. Expect to remove with `\` revisions.
|
|
0 commit comments