@@ -64,8 +64,14 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
6464 @test A[kr,jr] == A. A[kr,jr]
6565 end
6666 b = randn (5 )
67+ B = randn (5 ,5 )
6768 for Tri in (UpperTriangular, UnitUpperTriangular, LowerTriangular, UnitLowerTriangular)
6869 @test ldiv! (Tri (A), copy (b)) ≈ ldiv! (Tri (A. A), copy (b)) ≈ Tri (A. A) \ MyVector (b)
70+ @test ldiv! (Tri (A), copy (B)) ≈ ldiv! (Tri (A. A), copy (B)) ≈ Tri (A. A) \ MyMatrix (B)
71+ if VERSION ≥ v " 1.9"
72+ @test rdiv! (copy (b)' , Tri (A)) ≈ rdiv! (copy (b)' , Tri (A. A)) ≈ MyVector (b)' / Tri (A. A)
73+ @test rdiv! (copy (B), Tri (A)) ≈ rdiv! (copy (B), Tri (A. A)) ≈ B / Tri (A. A)
74+ end
6975 @test lmul! (Tri (A), copy (b)) ≈ lmul! (Tri (A. A), copy (b)) ≈ Tri (A. A) * MyVector (b)
7076 end
7177
@@ -112,7 +118,7 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
112118 @test cholesky (S, CRowMaximum ()) \ b ≈ ldiv! (cholesky (Matrix (S), CRowMaximum ()), copy (MyVector (b)))
113119 @test cholesky (S) \ b ≈ Matrix (S) \ b ≈ Symmetric (Matrix (S)) \ b
114120 @test cholesky (S) \ b ≈ Symmetric (Matrix (S)) \ MyVector (b)
115- if VERSION >= v " 1.9- "
121+ if VERSION >= v " 1.9"
116122 @test S \ b ≈ Matrix (S) \ b ≈ Symmetric (Matrix (S)) \ b
117123 @test S \ b ≈ Symmetric (Matrix (S)) \ MyVector (b)
118124 end
@@ -122,19 +128,19 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
122128 @test cholesky (S,CRowMaximum ()). U ≈ cholesky (Matrix (S),CRowMaximum ()). U
123129 @test cholesky (S) \ b ≈ Matrix (S) \ b ≈ Symmetric (Matrix (S), :L ) \ b
124130 @test cholesky (S) \ b ≈ Symmetric (Matrix (S), :L ) \ MyVector (b)
125- if VERSION >= v " 1.9- "
131+ if VERSION >= v " 1.9"
126132 @test S \ b ≈ Matrix (S) \ b ≈ Symmetric (Matrix (S), :L ) \ b
127133 @test S \ b ≈ Symmetric (Matrix (S), :L ) \ MyVector (b)
128134 end
129135
130136 @testset " ldiv!" begin
131137 c = MyVector (randn (5 ))
132- if VERSION < v " 1.9- "
138+ if VERSION < v " 1.9"
133139 @test_broken ldiv! (lu (A), MyVector (copy (c))) ≈ A \ c
134140 else
135141 @test ldiv! (lu (A), MyVector (copy (c))) ≈ A \ c
136142 end
137- if VERSION < v " 1.9- " || VERSION >= v " 1.10-"
143+ if VERSION < v " 1.9" || VERSION >= v " 1.10-"
138144 @test_throws ErrorException ldiv! (qr (A), MyVector (copy (c)))
139145 else
140146 @test_throws MethodError ldiv! (qr (A), MyVector (copy (c)))
@@ -221,18 +227,24 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
221227 @test_broken ldiv! (A, t) ≈ A\ t
222228 @test ldiv! (A, copy (X)) ≈ A\ X
223229 @test A\ T ≈ A\ T̃
224- VERSION >= v " 1.9- " && @test A/ T ≈ A/ T̃
230+ VERSION >= v " 1.9" && @test A/ T ≈ A/ T̃
225231 @test_broken ldiv! (A, T) ≈ A\ T
226232 @test B\ A ≈ B\ Matrix (A)
227233 @test D \ A ≈ D \ Matrix (A)
228234 @test transpose (B)\ A ≈ transpose (B)\ Matrix (A) ≈ Transpose (B)\ A ≈ Adjoint (B)\ A
229235 @test B' \ A ≈ B' \ Matrix (A)
230236 @test A\ A ≈ I
231- VERSION >= v " 1.9- " && @test A/ A ≈ I
237+ VERSION >= v " 1.9" && @test A/ A ≈ I
232238 @test A\ MyVector (x) ≈ A\ x
233239 @test A\ MyMatrix (X) ≈ A\ X
234240
235- VERSION >= v " 1.9-" && @test A/ A ≈ A. A / A. A
241+ if VERSION >= v " 1.9"
242+ @test A/ A ≈ A. A / A. A
243+ @test x' / A ≈ x' / A. A
244+ @test transpose (x) / A ≈ transpose (x) / A. A
245+ @test transpose (x) / A isa Transpose
246+ @test x' / A isa Adjoint
247+ end
236248 end
237249
238250 @testset " dot" begin
@@ -455,6 +467,13 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
455467 @test UpperTriangular (A) * UnitUpperTriangular (A' ) ≈ UpperTriangular (A. A) * UnitUpperTriangular (A. A' )
456468 @test UpperTriangular (A' ) * UnitUpperTriangular (A' ) ≈ UpperTriangular (A. A' ) * UnitUpperTriangular (A. A' )
457469 end
470+
471+ if isdefined (LinearAlgebra, :copymutable_oftype )
472+ @testset " copymutable_oftype" begin
473+ A = MyMatrix (randn (3 ,3 ))
474+ @test LinearAlgebra. copymutable_oftype (A, BigFloat) == A
475+ end
476+ end
458477end
459478
460479struct MyUpperTriangular{T} <: AbstractMatrix{T}
@@ -498,5 +517,5 @@ triangulardata(A::MyUpperTriangular) = triangulardata(A.A)
498517 @test_skip lmul! (U,view (copy (B),collect (1 : 5 ),1 : 5 )) ≈ U * B
499518
500519 @test MyMatrix (A) / U ≈ A / U
501- VERSION >= v " 1.9- " && @test U / MyMatrix (A) ≈ U / A
520+ VERSION >= v " 1.9" && @test U / MyMatrix (A) ≈ U / A
502521end
0 commit comments