File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ If a symmetric view of a matrix is to be constructed of which the elements are n
73
73
matrices nor numbers, an appropriate method of `symmetric` has to be implemented. In that
74
74
case, `symmetric_type` has to be implemented, too.
75
75
"""
76
- symmetric (A:: AbstractMatrix , uplo:: Symbol ) = Symmetric (A, uplo)
77
- symmetric (A:: Number , :: Symbol ) = A
76
+ symmetric (A:: AbstractMatrix , uplo:: Symbol = :U ) = Symmetric (A, uplo)
77
+ symmetric (A:: Number , :: Symbol = :U ) = A
78
78
79
79
"""
80
80
symmetric_type(T::Type)
@@ -164,8 +164,8 @@ If a hermitian view of a matrix is to be constructed of which the elements are n
164
164
matrices nor numbers, an appropriate method of `hermitian` has to be implemented. In that
165
165
case, `hermitian_type` has to be implemented, too.
166
166
"""
167
- hermitian (A:: AbstractMatrix , uplo:: Symbol ) = Hermitian (A, uplo)
168
- hermitian (A:: Number , :: Symbol ) = convert (typeof (A), real (A))
167
+ hermitian (A:: AbstractMatrix , uplo:: Symbol = :U ) = Hermitian (A, uplo)
168
+ hermitian (A:: Number , :: Symbol = :U ) = convert (typeof (A), real (A))
169
169
170
170
"""
171
171
hermitian_type(T::Type)
Original file line number Diff line number Diff line change 727
727
end
728
728
729
729
@testset " symmetric()/hermitian() for Numbers" begin
730
- @test LinearAlgebra. symmetric (1 , :U ) == 1
730
+ @test LinearAlgebra. symmetric (1 ) == LinearAlgebra . symmetric ( 1 , :U ) == 1
731
731
@test LinearAlgebra. symmetric_type (Int) == Int
732
- @test LinearAlgebra. hermitian (1 , :U ) == 1
732
+ @test LinearAlgebra. hermitian (1 ) == LinearAlgebra . hermitian ( 1 , :U ) == 1
733
733
@test LinearAlgebra. hermitian_type (Int) == Int
734
734
end
735
735
900
900
end
901
901
end
902
902
903
+ @testset " symmetric/hermitian for matrices" begin
904
+ A = [1 2 ; 3 4 ]
905
+ @test LinearAlgebra. symmetric (A) === Symmetric (A)
906
+ @test LinearAlgebra. symmetric (A, :L ) === Symmetric (A, :L )
907
+ @test LinearAlgebra. hermitian (A) === Hermitian (A)
908
+ @test LinearAlgebra. hermitian (A, :L ) === Hermitian (A, :L )
909
+ end
910
+
903
911
end # module TestSymmetric
You can’t perform that action at this time.
0 commit comments