Skip to content

Commit 7a3e21f

Browse files
jishnubKristofferC
authored and
KristofferC
committed
Update symmetric docstring to reflect the type of uplo (#55504)
This brings the docstring closer to the actual implementation. In particular, following the current docstring and defining ```julia symmetric(::MyMatrix, uplo=:U) ``` leads to a method ambiguity, as `LinearAlgebra` defines `symmetric(::AbstractMatrix, uplo::Symbol=:U)`. (cherry picked from commit 8a19b74)
1 parent 876853b commit 7a3e21f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stdlib/LinearAlgebra/src/symmetric.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct Symmetric{T,S<:AbstractMatrix{<:T}} <: AbstractMatrix{T}
1212
end
1313
end
1414
"""
15-
Symmetric(A, uplo=:U)
15+
Symmetric(A::AbstractMatrix, uplo::Symbol=:U)
1616
1717
Construct a `Symmetric` view of the upper (if `uplo = :U`) or lower (if `uplo = :L`)
1818
triangle of the matrix `A`.
@@ -63,7 +63,7 @@ function Symmetric(A::AbstractMatrix, uplo::Symbol=:U)
6363
end
6464

6565
"""
66-
symmetric(A, uplo=:U)
66+
symmetric(A, uplo::Symbol=:U)
6767
6868
Construct a symmetric view of `A`. If `A` is a matrix, `uplo` controls whether the upper
6969
(if `uplo = :U`) or lower (if `uplo = :L`) triangle of `A` is used to implicitly fill the
@@ -105,7 +105,7 @@ struct Hermitian{T,S<:AbstractMatrix{<:T}} <: AbstractMatrix{T}
105105
end
106106
end
107107
"""
108-
Hermitian(A, uplo=:U)
108+
Hermitian(A::AbstractMatrix, uplo::Symbol=:U)
109109
110110
Construct a `Hermitian` view of the upper (if `uplo = :U`) or lower (if `uplo = :L`)
111111
triangle of the matrix `A`.
@@ -153,7 +153,7 @@ function Hermitian(A::AbstractMatrix, uplo::Symbol=:U)
153153
end
154154

155155
"""
156-
hermitian(A, uplo=:U)
156+
hermitian(A, uplo::Symbol=:U)
157157
158158
Construct a hermitian view of `A`. If `A` is a matrix, `uplo` controls whether the upper
159159
(if `uplo = :U`) or lower (if `uplo = :L`) triangle of `A` is used to implicitly fill the
@@ -844,7 +844,7 @@ function cbrt(A::HermOrSym{<:Real})
844844
end
845845

846846
"""
847-
hermitianpart(A, uplo=:U) -> Hermitian
847+
hermitianpart(A::AbstractMatrix, uplo::Symbol=:U) -> Hermitian
848848
849849
Return the Hermitian part of the square matrix `A`, defined as `(A + A') / 2`, as a
850850
[`Hermitian`](@ref) matrix. For real matrices `A`, this is also known as the symmetric part
@@ -860,7 +860,7 @@ See also [`hermitianpart!`](@ref) for the corresponding in-place operation.
860860
hermitianpart(A::AbstractMatrix, uplo::Symbol=:U) = Hermitian(_hermitianpart(A), uplo)
861861

862862
"""
863-
hermitianpart!(A, uplo=:U) -> Hermitian
863+
hermitianpart!(A::AbstractMatrix, uplo::Symbol=:U) -> Hermitian
864864
865865
Overwrite the square matrix `A` in-place with its Hermitian part `(A + A') / 2`, and return
866866
[`Hermitian(A, uplo)`](@ref). For real matrices `A`, this is also known as the symmetric

0 commit comments

Comments
 (0)