Skip to content

Commit 8a19b74

Browse files
authored
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)`.
1 parent 0a26e90 commit 8a19b74

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
@@ -998,7 +998,7 @@ function cbrt(A::HermOrSym{<:Real})
998998
end
999999

10001000
"""
1001-
hermitianpart(A, uplo=:U) -> Hermitian
1001+
hermitianpart(A::AbstractMatrix, uplo::Symbol=:U) -> Hermitian
10021002
10031003
Return the Hermitian part of the square matrix `A`, defined as `(A + A') / 2`, as a
10041004
[`Hermitian`](@ref) matrix. For real matrices `A`, this is also known as the symmetric part
@@ -1014,7 +1014,7 @@ See also [`hermitianpart!`](@ref) for the corresponding in-place operation.
10141014
hermitianpart(A::AbstractMatrix, uplo::Symbol=:U) = Hermitian(_hermitianpart(A), uplo)
10151015

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

0 commit comments

Comments
 (0)