Skip to content

Commit

Permalink
merge docstrings of ' and adjoint
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonschaub committed Apr 30, 2020
1 parent 181dfbb commit f5762f7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
20 changes: 0 additions & 20 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -486,26 +486,6 @@ Expr
"""
Expr

"""
'
The conjugate transposition operator, see [`adjoint`](@ref).
# Examples
```jldoctest
julia> A = [1.0 -2.0im; 4.0im 2.0]
2×2 Array{Complex{Float64},2}:
1.0+0.0im -0.0-2.0im
0.0+4.0im 2.0+0.0im
julia> A'
2×2 Array{Complex{Float64},2}:
1.0-0.0im 0.0-4.0im
-0.0+2.0im 2.0-0.0im
```
"""
kw"'"

"""
\$
Expand Down
16 changes: 14 additions & 2 deletions stdlib/LinearAlgebra/src/adjtrans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,14 @@ Base.unaliascopy(A::Union{Adjoint,Transpose}) = typeof(A)(Base.unaliascopy(A.par

# wrapping lowercase quasi-constructors
"""
A'
adjoint(A)
Lazy adjoint (conjugate transposition) (also postfix `'`).
Note that `adjoint` is applied recursively to elements.
Lazy adjoint (conjugate transposition). Note that `adjoint` is applied recursively to
elements.
For number types, `adjoint` returns the complex conjugate, and therefore it is equivalent to
the identity function for real numbers.
This operation is intended for linear algebra usage - for general data manipulation see
[`permutedims`](@ref Base.permutedims).
Expand All @@ -119,6 +123,14 @@ julia> adjoint(A)
2×2 Adjoint{Complex{Int64},Array{Complex{Int64},2}}:
3-2im 8-7im
9-2im 4-6im
julia> x = [3, 4im]
2-element Array{Complex{Int64},1}:
3 + 0im
0 + 4im
julia> x'x
25 + 0im
```
"""
adjoint(A::AbstractVecOrMat) = Adjoint(A)
Expand Down
3 changes: 2 additions & 1 deletion stdlib/REPL/src/docview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function _helpmode(io::IO, line::AbstractString)
x = Meta.parse(line, raise = false, depwarn = false)
assym = Symbol(line)
expr =
if haskey(keywords, assym) || Base.isoperator(assym) || isexpr(x, :error) || isexpr(x, :invalid)
if haskey(keywords, Symbol(line)) || Base.isoperator(assym) || isexpr(x, :error) ||
isexpr(x, :invalid) || isexpr(x, :incomplete)
# Docs for keywords must be treated separately since trying to parse a single
# keyword such as `function` would throw a parse error due to the missing `end`.
assym
Expand Down

0 comments on commit f5762f7

Please sign in to comment.