Skip to content

Commit df9b1b0

Browse files
andyferrisandreasnoack
authored andcommitted
Rename ctranspose to adjoint (#23235)
* Rename `ctranspose` to `adjoint` * Add PR number and missing `!` * Remove dated commented out test
1 parent db88dd1 commit df9b1b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+178
-173
lines changed

NEWS.md

+3
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ Deprecated or removed
318318
* `Base.cpad` has been removed; use an appropriate combination of `rpad` and `lpad`
319319
instead ([#23187]).
320320

321+
* `ctranspose` and `ctranspose!` have been deprecated in favor of `adjoint` and `adjoint!`,
322+
respectively ([#23235]).
323+
321324
* `filter` and `filter!` on dictionaries now pass a single `key=>value` pair to the
322325
argument function, instead of two arguments ([#17886]).
323326

base/deprecated.jl

+5-1
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ end
14211421
module Operators
14221422
for op in [:!, :(!=), :(!==), :%, :&, :*, :+, :-, :/, ://, :<, :<:, :<<, :(<=),
14231423
:<|, :(==), :(===), :>, :>:, :(>=), :>>, :>>>, :\, :^, :colon,
1424-
:ctranspose, :getindex, :hcat, :hvcat, :setindex!, :transpose, :vcat,
1424+
:adjoint, :getindex, :hcat, :hvcat, :setindex!, :transpose, :vcat,
14251425
:xor, :|, :|>, :~, :×, :÷, :, :, :, :, :, :, :, :, :, :, :,
14261426
:, :, :, :, :, :]
14271427
if isdefined(Base, op)
@@ -1692,6 +1692,10 @@ export hex2num
16921692
# PR #22742: change in isapprox semantics
16931693
@deprecate rtoldefault(x,y) rtoldefault(x,y,0) false
16941694

1695+
# PR #23235
1696+
@deprecate ctranspose adjoint
1697+
@deprecate ctranspose! adjoint!
1698+
16951699
# issue #5148, PR #23259
16961700
# warning for `const` on locals should be changed to an error in julia-syntax.scm
16971701

base/exports.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,8 @@ export
555555
cond,
556556
condskeel,
557557
cross,
558-
ctranspose!,
559-
ctranspose,
558+
adjoint!,
559+
adjoint,
560560
det,
561561
diag,
562562
diagind,

base/linalg/bidiag.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ broadcast(::typeof(floor), ::Type{T}, M::Bidiagonal) where {T<:Integer} = Bidiag
223223
broadcast(::typeof(ceil), ::Type{T}, M::Bidiagonal) where {T<:Integer} = Bidiagonal(ceil.(T, M.dv), ceil.(T, M.ev), M.uplo)
224224

225225
transpose(M::Bidiagonal) = Bidiagonal(M.dv, M.ev, M.uplo == 'U' ? :L : :U)
226-
ctranspose(M::Bidiagonal) = Bidiagonal(conj(M.dv), conj(M.ev), M.uplo == 'U' ? :L : :U)
226+
adjoint(M::Bidiagonal) = Bidiagonal(conj(M.dv), conj(M.ev), M.uplo == 'U' ? :L : :U)
227227

228228
istriu(M::Bidiagonal) = M.uplo == 'U' || iszero(M.ev)
229229
istril(M::Bidiagonal) = M.uplo == 'L' || iszero(M.ev)
@@ -458,7 +458,7 @@ end
458458
#Linear solvers
459459
A_ldiv_B!(A::Union{Bidiagonal, AbstractTriangular}, b::AbstractVector) = naivesub!(A, b)
460460
At_ldiv_B!(A::Bidiagonal, b::AbstractVector) = A_ldiv_B!(transpose(A), b)
461-
Ac_ldiv_B!(A::Bidiagonal, b::AbstractVector) = A_ldiv_B!(ctranspose(A), b)
461+
Ac_ldiv_B!(A::Bidiagonal, b::AbstractVector) = A_ldiv_B!(adjoint(A), b)
462462
function A_ldiv_B!(A::Union{Bidiagonal,AbstractTriangular}, B::AbstractMatrix)
463463
nA,mA = size(A)
464464
tmp = similar(B,size(B,1))

base/linalg/bitarray.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,4 @@ function transpose(B::BitMatrix)
295295
return Bt
296296
end
297297

298-
ctranspose(B::Union{BitMatrix,BitVector}) = transpose(B)
298+
adjoint(B::Union{BitMatrix,BitVector}) = transpose(B)

base/linalg/cholesky.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function chol(A::RealHermSymComplexHerm)
150150
if A.uplo == 'U'
151151
copy!(AA, A.data)
152152
else
153-
Base.ctranspose!(AA, A.data)
153+
Base.adjoint!(AA, A.data)
154154
end
155155
chol!(Hermitian(AA, :U))
156156
end

base/linalg/conjarray.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
A lazy-view wrapper of an `AbstractArray`, taking the elementwise complex conjugate. This
77
type is usually constructed (and unwrapped) via the [`conj`](@ref) function (or related
8-
[`ctranspose`](@ref)), but currently this is the default behavior for `RowVector` only. For
8+
[`adjoint`](@ref)), but currently this is the default behavior for `RowVector` only. For
99
other arrays, the `ConjArray` constructor can be used directly.
1010
1111
# Examples

base/linalg/diagonal.jl

+12-12
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ function A_mul_B!(D::Diagonal, B::UnitUpperTriangular)
186186
UpperTriangular(B.data)
187187
end
188188

189-
Ac_mul_B(D::Diagonal, B::Diagonal) = Diagonal(ctranspose.(D.diag) .* B.diag)
190-
Ac_mul_B(A::AbstractTriangular, D::Diagonal) = A_mul_B!(ctranspose(A), D)
189+
Ac_mul_B(D::Diagonal, B::Diagonal) = Diagonal(adjoint.(D.diag) .* B.diag)
190+
Ac_mul_B(A::AbstractTriangular, D::Diagonal) = A_mul_B!(adjoint(A), D)
191191
function Ac_mul_B(A::AbstractMatrix, D::Diagonal)
192192
Ac = similar(A, promote_op(*, eltype(A), eltype(D.diag)), (size(A, 2), size(A, 1)))
193-
ctranspose!(Ac, A)
193+
adjoint!(Ac, A)
194194
A_mul_B!(Ac, D)
195195
end
196196

@@ -202,12 +202,12 @@ function At_mul_B(A::AbstractMatrix, D::Diagonal)
202202
A_mul_B!(At, D)
203203
end
204204

205-
A_mul_Bc(D::Diagonal, B::Diagonal) = Diagonal(D.diag .* ctranspose.(B.diag))
206-
A_mul_Bc(D::Diagonal, B::AbstractTriangular) = A_mul_B!(D, ctranspose(B))
205+
A_mul_Bc(D::Diagonal, B::Diagonal) = Diagonal(D.diag .* adjoint.(B.diag))
206+
A_mul_Bc(D::Diagonal, B::AbstractTriangular) = A_mul_B!(D, adjoint(B))
207207
A_mul_Bc(D::Diagonal, Q::Union{Base.LinAlg.QRCompactWYQ,Base.LinAlg.QRPackedQ}) = A_mul_Bc!(Array(D), Q)
208208
function A_mul_Bc(D::Diagonal, A::AbstractMatrix)
209209
Ac = similar(A, promote_op(*, eltype(A), eltype(D.diag)), (size(A, 2), size(A, 1)))
210-
ctranspose!(Ac, A)
210+
adjoint!(Ac, A)
211211
A_mul_B!(D, Ac)
212212
end
213213

@@ -219,7 +219,7 @@ function A_mul_Bt(D::Diagonal, A::AbstractMatrix)
219219
A_mul_B!(D, At)
220220
end
221221

222-
Ac_mul_Bc(D::Diagonal, B::Diagonal) = Diagonal(ctranspose.(D.diag) .* ctranspose.(B.diag))
222+
Ac_mul_Bc(D::Diagonal, B::Diagonal) = Diagonal(adjoint.(D.diag) .* adjoint.(B.diag))
223223
At_mul_Bt(D::Diagonal, B::Diagonal) = Diagonal(transpose.(D.diag) .* transpose.(B.diag))
224224

225225
A_mul_B!(A::Diagonal,B::Diagonal) = throw(MethodError(A_mul_B!, Tuple{Diagonal,Diagonal}))
@@ -235,11 +235,11 @@ A_mul_Bc!(A::AbstractMatrix,B::Diagonal) = scale!(A,conj(B.diag))
235235

236236
# Get ambiguous method if try to unify AbstractVector/AbstractMatrix here using AbstractVecOrMat
237237
A_mul_B!(out::AbstractVector, A::Diagonal, in::AbstractVector) = out .= A.diag .* in
238-
Ac_mul_B!(out::AbstractVector, A::Diagonal, in::AbstractVector) = out .= ctranspose.(A.diag) .* in
238+
Ac_mul_B!(out::AbstractVector, A::Diagonal, in::AbstractVector) = out .= adjoint.(A.diag) .* in
239239
At_mul_B!(out::AbstractVector, A::Diagonal, in::AbstractVector) = out .= transpose.(A.diag) .* in
240240

241241
A_mul_B!(out::AbstractMatrix, A::Diagonal, in::AbstractMatrix) = out .= A.diag .* in
242-
Ac_mul_B!(out::AbstractMatrix, A::Diagonal, in::AbstractMatrix) = out .= ctranspose.(A.diag) .* in
242+
Ac_mul_B!(out::AbstractMatrix, A::Diagonal, in::AbstractMatrix) = out .= adjoint.(A.diag) .* in
243243
At_mul_B!(out::AbstractMatrix, A::Diagonal, in::AbstractMatrix) = out .= transpose.(A.diag) .* in
244244

245245
# ambiguities with Symmetric/Hermitian
@@ -306,13 +306,13 @@ A_rdiv_Bt!(A::AbstractMatrix{T}, D::Diagonal{T}) where {T} = A_rdiv_B!(A, D)
306306
# Methods to resolve ambiguities with `Diagonal`
307307
@inline *(rowvec::RowVector, D::Diagonal) = transpose(D * transpose(rowvec))
308308
@inline A_mul_Bt(D::Diagonal, rowvec::RowVector) = D*transpose(rowvec)
309-
@inline A_mul_Bc(D::Diagonal, rowvec::RowVector) = D*ctranspose(rowvec)
309+
@inline A_mul_Bc(D::Diagonal, rowvec::RowVector) = D*adjoint(rowvec)
310310

311311
conj(D::Diagonal) = Diagonal(conj(D.diag))
312312
transpose(D::Diagonal{<:Number}) = D
313313
transpose(D::Diagonal) = Diagonal(transpose.(D.diag))
314-
ctranspose(D::Diagonal{<:Number}) = conj(D)
315-
ctranspose(D::Diagonal) = Diagonal(ctranspose.(D.diag))
314+
adjoint(D::Diagonal{<:Number}) = conj(D)
315+
adjoint(D::Diagonal) = Diagonal(adjoint.(D.diag))
316316

317317
diag(D::Diagonal) = D.diag
318318
trace(D::Diagonal) = sum(D.diag)

base/linalg/factorization.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ abstract type Factorization{T} end
66

77
eltype(::Type{Factorization{T}}) where {T} = T
88
transpose(F::Factorization) = error("transpose not implemented for $(typeof(F))")
9-
ctranspose(F::Factorization) = error("ctranspose not implemented for $(typeof(F))")
9+
adjoint(F::Factorization) = error("adjoint not implemented for $(typeof(F))")
1010

1111
macro assertposdef(A, info)
1212
:($(esc(info)) == 0 ? $(esc(A)) : throw(PosDefException($(esc(info)))))

base/linalg/generic.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ function ishermitian(A::AbstractMatrix)
942942
return false
943943
end
944944
for i = indsn, j = i:last(indsn)
945-
if A[i,j] != ctranspose(A[j,i])
945+
if A[i,j] != adjoint(A[j,i])
946946
return false
947947
end
948948
end

base/linalg/givens.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ convert(::Type{Rotation{T}}, R::Rotation) where {T} = Rotation{T}([convert(Given
4141
convert(::Type{AbstractRotation{T}}, G::Givens) where {T} = convert(Givens{T}, G)
4242
convert(::Type{AbstractRotation{T}}, R::Rotation) where {T} = convert(Rotation{T}, R)
4343

44-
ctranspose(G::Givens) = Givens(G.i1, G.i2, conj(G.c), -G.s)
45-
ctranspose(R::Rotation{T}) where {T} = Rotation{T}(reverse!([ctranspose(r) for r in R.rotations]))
44+
adjoint(G::Givens) = Givens(G.i1, G.i2, conj(G.c), -G.s)
45+
adjoint(R::Rotation{T}) where {T} = Rotation{T}(reverse!([adjoint(r) for r in R.rotations]))
4646

4747
realmin2(::Type{Float32}) = reinterpret(Float32, 0x26000000)
4848
realmin2(::Type{Float64}) = reinterpret(Float64, 0x21a0000000000000)

base/linalg/linalg.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Base: \, /, *, ^, +, -, ==
66
import Base: A_mul_Bt, At_ldiv_Bt, A_rdiv_Bc, At_ldiv_B, Ac_mul_Bc, A_mul_Bc, Ac_mul_B,
77
Ac_ldiv_B, Ac_ldiv_Bc, At_mul_Bt, A_rdiv_Bt, At_mul_B
88
import Base: USE_BLAS64, abs, big, broadcast, ceil, conj, convert, copy, copy!,
9-
ctranspose, eltype, eye, findmax, findmin, fill!, floor, full, getindex,
9+
adjoint, eltype, eye, findmax, findmin, fill!, floor, full, getindex,
1010
hcat, imag, indices, inv, isapprox, isone, IndexStyle, kron, length, map,
1111
ndims, oneunit, parent, power_by_squaring, print_matrix, promote_rule, real, round,
1212
setindex!, show, similar, size, transpose, trunc, typed_hcat
@@ -63,8 +63,8 @@ export
6363
copy!,
6464
copy_transpose!,
6565
cross,
66-
ctranspose,
67-
ctranspose!,
66+
adjoint,
67+
adjoint!,
6868
det,
6969
diag,
7070
diagind,

base/linalg/lq.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ convert(::Type{Matrix}, A::LQ) = convert(Array, convert(AbstractArray, A))
5656
convert(::Type{Array}, A::LQ) = convert(Matrix, A)
5757
full(A::LQ) = convert(AbstractArray, A)
5858

59-
ctranspose(A::LQ{T}) where {T} = QR{T,typeof(A.factors)}(A.factors', A.τ)
59+
adjoint(A::LQ{T}) where {T} = QR{T,typeof(A.factors)}(A.factors', A.τ)
6060

6161
function getindex(A::LQ, d::Symbol)
6262
m, n = size(A)
@@ -164,7 +164,7 @@ for (f1, f2) in ((:A_mul_Bc, :A_mul_B!),
164164
function ($f1)(A::LQPackedQ, B::StridedVecOrMat)
165165
TAB = promote_type(eltype(A), eltype(B))
166166
BB = similar(B, TAB, (size(B, 2), size(B, 1)))
167-
ctranspose!(BB, B)
167+
adjoint!(BB, B)
168168
return ($f2)(A, BB)
169169
end
170170
end
@@ -198,7 +198,7 @@ for (f1, f2) in ((:Ac_mul_B, :A_mul_B!),
198198
function ($f1)(A::StridedMatrix, B::LQPackedQ)
199199
TAB = promote_type(eltype(A), eltype(B))
200200
AA = similar(A, TAB, (size(A, 2), size(A, 1)))
201-
ctranspose!(AA, A)
201+
adjoint!(AA, A)
202202
return ($f2)(AA, B)
203203
end
204204
end

base/linalg/lu.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ At_ldiv_Bt(A::LU{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasFloat}
275275
At_ldiv_Bt(A::LU, B::StridedVecOrMat) = At_ldiv_B(A, transpose(B))
276276

277277
Ac_ldiv_Bc(A::LU{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasComplex} =
278-
@assertnonsingular LAPACK.getrs!('C', A.factors, A.ipiv, ctranspose(B)) A.info
279-
Ac_ldiv_Bc(A::LU, B::StridedVecOrMat) = Ac_ldiv_B(A, ctranspose(B))
278+
@assertnonsingular LAPACK.getrs!('C', A.factors, A.ipiv, adjoint(B)) A.info
279+
Ac_ldiv_Bc(A::LU, B::StridedVecOrMat) = Ac_ldiv_B(A, adjoint(B))
280280

281281
function det(F::LU{T}) where T
282282
n = checksquare(F)

base/linalg/matmul.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -663,14 +663,14 @@ function matmul2x2!(C::AbstractMatrix, tA, tB, A::AbstractMatrix, B::AbstractMat
663663
if tA == 'T'
664664
A11 = transpose(A[1,1]); A12 = transpose(A[2,1]); A21 = transpose(A[1,2]); A22 = transpose(A[2,2])
665665
elseif tA == 'C'
666-
A11 = ctranspose(A[1,1]); A12 = ctranspose(A[2,1]); A21 = ctranspose(A[1,2]); A22 = ctranspose(A[2,2])
666+
A11 = adjoint(A[1,1]); A12 = adjoint(A[2,1]); A21 = adjoint(A[1,2]); A22 = adjoint(A[2,2])
667667
else
668668
A11 = A[1,1]; A12 = A[1,2]; A21 = A[2,1]; A22 = A[2,2]
669669
end
670670
if tB == 'T'
671671
B11 = transpose(B[1,1]); B12 = transpose(B[2,1]); B21 = transpose(B[1,2]); B22 = transpose(B[2,2])
672672
elseif tB == 'C'
673-
B11 = ctranspose(B[1,1]); B12 = ctranspose(B[2,1]); B21 = ctranspose(B[1,2]); B22 = ctranspose(B[2,2])
673+
B11 = adjoint(B[1,1]); B12 = adjoint(B[2,1]); B21 = adjoint(B[1,2]); B22 = adjoint(B[2,2])
674674
else
675675
B11 = B[1,1]; B12 = B[1,2]; B21 = B[2,1]; B22 = B[2,2]
676676
end
@@ -697,9 +697,9 @@ function matmul3x3!(C::AbstractMatrix, tA, tB, A::AbstractMatrix, B::AbstractMat
697697
A21 = transpose(A[1,2]); A22 = transpose(A[2,2]); A23 = transpose(A[3,2])
698698
A31 = transpose(A[1,3]); A32 = transpose(A[2,3]); A33 = transpose(A[3,3])
699699
elseif tA == 'C'
700-
A11 = ctranspose(A[1,1]); A12 = ctranspose(A[2,1]); A13 = ctranspose(A[3,1])
701-
A21 = ctranspose(A[1,2]); A22 = ctranspose(A[2,2]); A23 = ctranspose(A[3,2])
702-
A31 = ctranspose(A[1,3]); A32 = ctranspose(A[2,3]); A33 = ctranspose(A[3,3])
700+
A11 = adjoint(A[1,1]); A12 = adjoint(A[2,1]); A13 = adjoint(A[3,1])
701+
A21 = adjoint(A[1,2]); A22 = adjoint(A[2,2]); A23 = adjoint(A[3,2])
702+
A31 = adjoint(A[1,3]); A32 = adjoint(A[2,3]); A33 = adjoint(A[3,3])
703703
else
704704
A11 = A[1,1]; A12 = A[1,2]; A13 = A[1,3]
705705
A21 = A[2,1]; A22 = A[2,2]; A23 = A[2,3]
@@ -711,9 +711,9 @@ function matmul3x3!(C::AbstractMatrix, tA, tB, A::AbstractMatrix, B::AbstractMat
711711
B21 = transpose(B[1,2]); B22 = transpose(B[2,2]); B23 = transpose(B[3,2])
712712
B31 = transpose(B[1,3]); B32 = transpose(B[2,3]); B33 = transpose(B[3,3])
713713
elseif tB == 'C'
714-
B11 = ctranspose(B[1,1]); B12 = ctranspose(B[2,1]); B13 = ctranspose(B[3,1])
715-
B21 = ctranspose(B[1,2]); B22 = ctranspose(B[2,2]); B23 = ctranspose(B[3,2])
716-
B31 = ctranspose(B[1,3]); B32 = ctranspose(B[2,3]); B33 = ctranspose(B[3,3])
714+
B11 = adjoint(B[1,1]); B12 = adjoint(B[2,1]); B13 = adjoint(B[3,1])
715+
B21 = adjoint(B[1,2]); B22 = adjoint(B[2,2]); B23 = adjoint(B[3,2])
716+
B31 = adjoint(B[1,3]); B32 = adjoint(B[2,3]); B33 = adjoint(B[3,3])
717717
else
718718
B11 = B[1,1]; B12 = B[1,2]; B13 = B[1,3]
719719
B21 = B[2,1]; B22 = B[2,2]; B23 = B[2,3]

base/linalg/qr.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ for (f1, f2) in ((:A_mul_Bc, :A_mul_B!),
595595
function ($f1)(Q::AbstractQ, B::StridedVecOrMat)
596596
TQB = promote_type(eltype(Q), eltype(B))
597597
Bc = similar(B, TQB, (size(B, 2), size(B, 1)))
598-
ctranspose!(Bc, B)
598+
adjoint!(Bc, B)
599599
return ($f2)(convert(AbstractMatrix{TQB}, Q), Bc)
600600
end
601601
end
@@ -678,7 +678,7 @@ function A_mul_Bc(A::StridedMatrix, B::AbstractQ)
678678
throw(DimensionMismatch("matrix A has dimensions $(size(A)) but matrix B has dimensions $(size(B))"))
679679
end
680680
end
681-
@inline A_mul_Bc(rowvec::RowVector, B::AbstractQ) = ctranspose(B*ctranspose(rowvec))
681+
@inline A_mul_Bc(rowvec::RowVector, B::AbstractQ) = adjoint(B*adjoint(rowvec))
682682

683683

684684
### AcQ/AcQc
@@ -688,7 +688,7 @@ for (f1, f2) in ((:Ac_mul_B, :A_mul_B!),
688688
function ($f1)(A::StridedVecOrMat, Q::AbstractQ)
689689
TAQ = promote_type(eltype(A), eltype(Q))
690690
Ac = similar(A, TAQ, (size(A, 2), size(A, 1)))
691-
ctranspose!(Ac, A)
691+
adjoint!(Ac, A)
692692
return ($f2)(Ac, convert(AbstractMatrix{TAQ}, Q))
693693
end
694694
end

base/linalg/rowvector.jl

+16-16
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
A lazy-view wrapper of an [`AbstractVector`](@ref), which turns a length-`n` vector into a `1×n`
77
shaped row vector and represents the transpose of a vector (the elements are also transposed
88
recursively). This type is usually constructed (and unwrapped) via the [`transpose`](@ref)
9-
function or `.'` operator (or related [`ctranspose`](@ref) or `'` operator).
9+
function or `.'` operator (or related [`adjoint`](@ref) or `'` operator).
1010
1111
By convention, a vector can be multiplied by a matrix on its left (`A * v`) whereas a row
1212
vector can be multiplied by a matrix on its right (such that `v.' * A = (A.' * v).'`). It
@@ -75,12 +75,12 @@ julia> transpose(v)
7575
```
7676
"""
7777
@inline transpose(vec::AbstractVector) = RowVector(vec)
78-
@inline ctranspose(vec::AbstractVector) = RowVector(_conj(vec))
78+
@inline adjoint(vec::AbstractVector) = RowVector(_conj(vec))
7979

8080
@inline transpose(rowvec::RowVector) = rowvec.vec
8181
@inline transpose(rowvec::ConjRowVector) = copy(rowvec.vec) # remove the ConjArray wrapper from any raw vector
82-
@inline ctranspose(rowvec::RowVector) = conj(rowvec.vec)
83-
@inline ctranspose(rowvec::RowVector{<:Real}) = rowvec.vec
82+
@inline adjoint(rowvec::RowVector) = conj(rowvec.vec)
83+
@inline adjoint(rowvec::RowVector{<:Real}) = rowvec.vec
8484

8585
parent(rowvec::RowVector) = rowvec.vec
8686

@@ -208,24 +208,24 @@ At_mul_B(vec::AbstractVector, rowvec::RowVector) = throw(DimensionMismatch(
208208

209209
# Conjugated forms
210210
A_mul_Bc(::RowVector, ::AbstractVector) = throw(DimensionMismatch("Cannot multiply two transposed vectors"))
211-
@inline A_mul_Bc(rowvec::RowVector, mat::AbstractMatrix) = ctranspose(mat * ctranspose(rowvec))
212-
@inline A_mul_Bc(rowvec1::RowVector, rowvec2::RowVector) = rowvec1 * ctranspose(rowvec2)
211+
@inline A_mul_Bc(rowvec::RowVector, mat::AbstractMatrix) = adjoint(mat * adjoint(rowvec))
212+
@inline A_mul_Bc(rowvec1::RowVector, rowvec2::RowVector) = rowvec1 * adjoint(rowvec2)
213213
A_mul_Bc(vec::AbstractVector, rowvec::RowVector) = throw(DimensionMismatch("Cannot multiply two vectors"))
214-
@inline A_mul_Bc(vec1::AbstractVector, vec2::AbstractVector) = vec1 * ctranspose(vec2)
215-
@inline A_mul_Bc(mat::AbstractMatrix, rowvec::RowVector) = mat * ctranspose(rowvec)
214+
@inline A_mul_Bc(vec1::AbstractVector, vec2::AbstractVector) = vec1 * adjoint(vec2)
215+
@inline A_mul_Bc(mat::AbstractMatrix, rowvec::RowVector) = mat * adjoint(rowvec)
216216

217-
@inline Ac_mul_Bc(rowvec::RowVector, vec::AbstractVector) = ctranspose(rowvec) * ctranspose(vec)
218-
@inline Ac_mul_Bc(vec::AbstractVector, mat::AbstractMatrix) = ctranspose(mat * vec)
217+
@inline Ac_mul_Bc(rowvec::RowVector, vec::AbstractVector) = adjoint(rowvec) * adjoint(vec)
218+
@inline Ac_mul_Bc(vec::AbstractVector, mat::AbstractMatrix) = adjoint(mat * vec)
219219
Ac_mul_Bc(rowvec1::RowVector, rowvec2::RowVector) = throw(DimensionMismatch("Cannot multiply two vectors"))
220-
@inline Ac_mul_Bc(vec::AbstractVector, rowvec::RowVector) = ctranspose(vec)*ctranspose(rowvec)
220+
@inline Ac_mul_Bc(vec::AbstractVector, rowvec::RowVector) = adjoint(vec)*adjoint(rowvec)
221221
Ac_mul_Bc(vec::AbstractVector, rowvec::AbstractVector) = throw(DimensionMismatch("Cannot multiply two transposed vectors"))
222-
@inline Ac_mul_Bc(mat::AbstractMatrix, rowvec::RowVector) = mat' * ctranspose(rowvec)
222+
@inline Ac_mul_Bc(mat::AbstractMatrix, rowvec::RowVector) = mat' * adjoint(rowvec)
223223

224224
Ac_mul_B(::RowVector, ::AbstractVector) = throw(DimensionMismatch("Cannot multiply two vectors"))
225-
@inline Ac_mul_B(vec::AbstractVector, mat::AbstractMatrix) = ctranspose(Ac_mul_B(mat,vec))
226-
@inline Ac_mul_B(rowvec1::RowVector, rowvec2::RowVector) = ctranspose(rowvec1) * rowvec2
225+
@inline Ac_mul_B(vec::AbstractVector, mat::AbstractMatrix) = adjoint(Ac_mul_B(mat,vec))
226+
@inline Ac_mul_B(rowvec1::RowVector, rowvec2::RowVector) = adjoint(rowvec1) * rowvec2
227227
Ac_mul_B(vec::AbstractVector, rowvec::RowVector) = throw(DimensionMismatch("Cannot multiply two transposed vectors"))
228-
@inline Ac_mul_B(vec1::AbstractVector, vec2::AbstractVector) = ctranspose(vec1)*vec2
228+
@inline Ac_mul_B(vec1::AbstractVector, vec2::AbstractVector) = adjoint(vec1)*vec2
229229

230230
# Left Division #
231231

@@ -237,4 +237,4 @@ Ac_ldiv_B(mat::AbstractMatrix, rowvec::RowVector) = throw(DimensionMismatch("Can
237237

238238
@inline /(rowvec::RowVector, mat::AbstractMatrix) = transpose(transpose(mat) \ transpose(rowvec))
239239
@inline A_rdiv_Bt(rowvec::RowVector, mat::AbstractMatrix) = transpose(mat \ transpose(rowvec))
240-
@inline A_rdiv_Bc(rowvec::RowVector, mat::AbstractMatrix) = ctranspose(mat \ ctranspose(rowvec))
240+
@inline A_rdiv_Bc(rowvec::RowVector, mat::AbstractMatrix) = adjoint(mat \ adjoint(rowvec))

0 commit comments

Comments
 (0)