Skip to content

Commit 1319567

Browse files
authored
Merge pull request #25148 from Sacha0/despecial
update context-independent and remove context-dependent lowering of '
2 parents ea3639e + 6e3c1ce commit 1319567

Some content is hidden

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

49 files changed

+141
-168
lines changed

base/boot.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ macro _noinline_meta()
208208
Expr(:meta, :noinline)
209209
end
210210

211+
function postfixapostrophize end
212+
211213
struct BoundsError <: Exception
212214
a::Any
213215
i::Any

base/deprecated.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,7 +3047,7 @@ end
30473047
```jldoctest
30483048
julia> v = [1; im];
30493049
3050-
julia> vc = v';
3050+
julia> vc = RowVector(v);
30513051
30523052
julia> norm(vc, 1)
30533053
1.0
@@ -3103,7 +3103,7 @@ end
31033103
*(transA::Transpose{<:Any,<:AbstractTriangular}, transrowvec::Transpose{<:Any,<:RowVector}) = transA * rvtranspose(transrowvec.parent)
31043104
*(rowvec::RowVector, adjA::Adjoint{<:Any,<:AbstractTriangular}) = rvadjoint(adjA.parent * rvadjoint(rowvec))
31053105
*(A::AbstractTriangular, adjrowvec::Adjoint{<:Any,<:RowVector}) = A * rvadjoint(adjrowvec.parent)
3106-
*(adjA::Adjoint{<:Any,<:AbstractTriangular}, adjrowvec::Adjoint{<:Any,<:RowVector}) = adjA.parent' * rvadjoint(adjrowvec.parent)
3106+
*(adjA::Adjoint{<:Any,<:AbstractTriangular}, adjrowvec::Adjoint{<:Any,<:RowVector}) = adjA * rvadjoint(adjrowvec.parent)
31073107
\(::Union{UpperTriangular,LowerTriangular}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
31083108
\(::Union{UnitUpperTriangular,UnitLowerTriangular}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
31093109
\(::Adjoint{<:Any,<:Union{UpperTriangular,LowerTriangular}}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))

base/linalg/bidiag.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ function ldiv!(adjA::Adjoint{<:Any,<:Union{Bidiagonal,AbstractTriangular}}, B::A
522522
tmp = similar(B,size(B,1))
523523
n = size(B, 1)
524524
if mA != n
525-
throw(DimensionMismatch("size of A' is ($mA,$nA), corresponding dimension of B is $n"))
525+
throw(DimensionMismatch("size of adjoint of A is ($mA,$nA), corresponding dimension of B is $n"))
526526
end
527527
for i = 1:size(B,2)
528528
copyto!(tmp, 1, B, (i - 1)*n + 1, n)
@@ -537,7 +537,7 @@ function ldiv!(transA::Transpose{<:Any,<:Union{Bidiagonal,AbstractTriangular}},
537537
tmp = similar(B,size(B,1))
538538
n = size(B, 1)
539539
if mA != n
540-
throw(DimensionMismatch("size of A' is ($mA,$nA), corresponding dimension of B is $n"))
540+
throw(DimensionMismatch("size of transpose of A is ($mA,$nA), corresponding dimension of B is $n"))
541541
end
542542
for i = 1:size(B,2)
543543
copyto!(tmp, 1, B, (i - 1)*n + 1, n)

base/linalg/cholesky.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function _chol!(A::AbstractMatrix, ::Type{UpperTriangular})
8787
return UpperTriangular(A), info
8888
end
8989
A[k,k] = Akk
90-
AkkInv = inv(Akk')
90+
AkkInv = inv(adjoint(Akk))
9191
for j = k + 1:n
9292
for i = 1:k - 1
9393
A[k,j] -= A[i,k]'A[i,j]
@@ -381,14 +381,14 @@ size(C::Union{Cholesky, CholeskyPivoted}) = size(C.factors)
381381
size(C::Union{Cholesky, CholeskyPivoted}, d::Integer) = size(C.factors, d)
382382

383383
function getindex(C::Cholesky, d::Symbol)
384-
d == :U && return UpperTriangular(Symbol(C.uplo) == d ? C.factors : C.factors')
385-
d == :L && return LowerTriangular(Symbol(C.uplo) == d ? C.factors : C.factors')
384+
d == :U && return UpperTriangular(Symbol(C.uplo) == d ? C.factors : adjoint(C.factors))
385+
d == :L && return LowerTriangular(Symbol(C.uplo) == d ? C.factors : adjoint(C.factors))
386386
d == :UL && return Symbol(C.uplo) == :U ? UpperTriangular(C.factors) : LowerTriangular(C.factors)
387387
throw(KeyError(d))
388388
end
389389
function getindex(C::CholeskyPivoted{T}, d::Symbol) where T<:BlasFloat
390-
d == :U && return UpperTriangular(Symbol(C.uplo) == d ? C.factors : C.factors')
391-
d == :L && return LowerTriangular(Symbol(C.uplo) == d ? C.factors : C.factors')
390+
d == :U && return UpperTriangular(Symbol(C.uplo) == d ? C.factors : adjoint(C.factors))
391+
d == :L && return LowerTriangular(Symbol(C.uplo) == d ? C.factors : adjoint(C.factors))
392392
d == :p && return C.piv
393393
if d == :P
394394
n = size(C, 1)

base/linalg/conjarray.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ other arrays, the `ConjArray` constructor can be used directly.
1010
1111
# Examples
1212
```jldoctest
13-
julia> [1+im, 1-im]'
14-
1×2 RowVector{Complex{Int64},ConjArray{Complex{Int64},1,Array{Complex{Int64},1}}}:
15-
1-1im 1+1im
16-
1713
julia> ConjArray([1+im 0; 0 1-im])
1814
2×2 ConjArray{Complex{Int64},2,Array{Complex{Int64},2}}:
1915
1-1im 0+0im

base/linalg/dense.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ function nullspace(A::StridedMatrix{T}) where T
13501350
(m == 0 || n == 0) && return Matrix{T}(I, n, n)
13511351
SVD = svdfact(A, full = true)
13521352
indstart = sum(SVD.S .> max(m,n)*maximum(SVD.S)*eps(eltype(SVD.S))) + 1
1353-
return SVD.Vt[indstart:end,:]'
1353+
return adjoint(SVD.Vt[indstart:end,:])
13541354
end
13551355
nullspace(a::StridedVector) = nullspace(reshape(a, length(a), 1))
13561356

base/linalg/diagonal.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ function svd(D::Diagonal{<:Number})
471471
end
472472
function svdfact(D::Diagonal)
473473
U, s, V = svd(D)
474-
SVD(U, s, V')
474+
SVD(U, s, adjoint(V))
475475
end
476476

477477
# dismabiguation methods: * of Diagonal and Adj/Trans AbsVec

base/linalg/generic.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -816,15 +816,18 @@ function inv(A::AbstractMatrix{T}) where T
816816
ldiv!(factorize(convert(AbstractMatrix{S}, A)), dest)
817817
end
818818

819-
function pinv(v::AbstractVector{T}, tol::Real=real(zero(T))) where T
820-
res = similar(v, typeof(zero(T) / (abs2(one(T)) + abs2(one(T)))))'
819+
pinv(v::AbstractVector{T}, tol::Real = real(zero(T))) where {T<:Real} = _vectorpinv(Transpose, v, tol)
820+
pinv(v::AbstractVector{T}, tol::Real = real(zero(T))) where {T<:Complex} = _vectorpinv(Adjoint, v, tol)
821+
pinv(v::AbstractVector{T}, tol::Real = real(zero(T))) where {T} = _vectorpinv(Adjoint, v, tol)
822+
function _vectorpinv(dualfn::Tf, v::AbstractVector{Tv}, tol) where {Tv,Tf}
823+
res = dualfn(similar(v, typeof(zero(Tv) / (abs2(one(Tv)) + abs2(one(Tv))))))
821824
den = sum(abs2, v)
822825
# as tol is the threshold relative to the maximum singular value, for a vector with
823826
# single singular value σ=√den, σ ≦ tol*σ is equivalent to den=0 ∨ tol≥1
824827
if iszero(den) || tol >= one(tol)
825828
fill!(res, zero(eltype(res)))
826829
else
827-
res .= v' ./ den
830+
res .= dualfn(v) ./ den
828831
end
829832
return res
830833
end
@@ -882,7 +885,7 @@ function (\)(A::AbstractMatrix, B::AbstractVecOrMat)
882885
end
883886

884887
(\)(a::AbstractVector, b::AbstractArray) = pinv(a) * b
885-
(/)(A::AbstractVecOrMat, B::AbstractVecOrMat) = (B' \ A')'
888+
(/)(A::AbstractVecOrMat, B::AbstractVecOrMat) = adjoint(Adjoint(B) \ Adjoint(A))
886889
# \(A::StridedMatrix,x::Number) = inv(A)*x Should be added at some point when the old elementwise version has been deprecated long enough
887890
# /(x::Number,A::StridedMatrix) = x*inv(A)
888891
/(x::Number, v::AbstractVector) = x*pinv(v)
@@ -1290,7 +1293,7 @@ end
12901293
vAj += x[i]'*A[i, j]
12911294
end
12921295

1293-
vAj = τ'*vAj
1296+
vAj = conj(τ)*vAj
12941297

12951298
# ger
12961299
A[1, j] -= vAj

base/linalg/lq.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ convert(::Type{AbstractArray}, A::LQ) = convert(AbstractMatrix, A)
7070
convert(::Type{Matrix}, A::LQ) = convert(Array, convert(AbstractArray, A))
7171
convert(::Type{Array}, A::LQ) = convert(Matrix, A)
7272

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

7575
function getindex(A::LQ, d::Symbol)
7676
m, n = size(A)

base/linalg/qr.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ function ldiv!(A::QR{T}, B::StridedMatrix{T}) where T
796796
for k = m:-1:1 # Trapezoid to triangular by elementary operation
797797
x = view(R, k, [k; m + 1:n])
798798
τk = reflector!(x)
799-
τ[k] = τk'
799+
τ[k] = adjoint(τk)
800800
for i = 1:k - 1
801801
vRi = R[i,k]
802802
for j = m + 1:n

base/linalg/rowvector.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ IndexStyle(::Type{<:RowVector}) = IndexLinear()
199199

200200
# inner product -> dot product specializations
201201
@inline *(rowvec::RowVector{T}, vec::AbstractVector{T}) where {T<:Real} = dot(parent(rowvec), vec)
202-
@inline *(rowvec::ConjRowVector{T}, vec::AbstractVector{T}) where {T<:Real} = dot(rowvec', vec)
203-
@inline *(rowvec::ConjRowVector, vec::AbstractVector) = dot(rowvec', vec)
202+
@inline *(rowvec::ConjRowVector{T}, vec::AbstractVector{T}) where {T<:Real} = dot(rvadjoint(rowvec), vec)
203+
@inline *(rowvec::ConjRowVector, vec::AbstractVector) = dot(rvadjoint(rowvec), vec)
204204

205205
# Generic behavior
206206
@inline function *(rowvec::RowVector, vec::AbstractVector)
@@ -261,7 +261,7 @@ end
261261
*(adjvec::Adjoint{<:Any,<:AbstractVector}, adjrowvec::Adjoint{<:Any,<:RowVector}) =
262262
adjoint(adjvec.parent)*rvadjoint(adjrowvec.parent)
263263
*(adjmat::Adjoint{<:Any,<:AbstractMatrix}, adjrowvec::Adjoint{<:Any,<:RowVector}) =
264-
(adjmat.parent)' * rvadjoint(adjrowvec.parent)
264+
adjoint(adjmat.parent) * rvadjoint(adjrowvec.parent)
265265

266266
*(::Adjoint{<:Any,<:RowVector}, ::AbstractVector) = throw(DimensionMismatch("Cannot multiply two vectors"))
267267
*(adjrowvec1::Adjoint{<:Any,<:RowVector}, rowvec2::RowVector) = rvadjoint(adjrowvec1.parent) * rowvec2

base/linalg/svd.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function svd(A::AbstractArray; full::Bool = false, thin::Union{Bool,Void} = noth
165165
full::Bool = !thin
166166
end
167167
F = svdfact(A, full = full)
168-
F.U, F.S, F.Vt'
168+
F.U, F.S, adjoint(F.Vt)
169169
end
170170
function svd(x::Number; full::Bool = false, thin::Union{Bool,Void} = nothing)
171171
# DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7
@@ -186,7 +186,7 @@ function getindex(F::SVD, d::Symbol)
186186
elseif d == :Vt
187187
return F.Vt
188188
elseif d == :V
189-
return F.Vt'
189+
return adjoint(F.Vt)
190190
else
191191
throw(KeyError(d))
192192
end

base/linalg/symmetric.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ julia> Hlower = Hermitian(A, :L)
7373
2+2im 0+0im 3-3im 0+0im 4+0im
7474
```
7575
76-
Note that `Hupper` will not be equal to `Hlower` unless `A` is itself Hermitian (e.g. if `A == A'`).
76+
Note that `Hupper` will not be equal to `Hlower` unless `A` is itself Hermitian (e.g. if `A == adjoint(A)`).
7777
7878
All non-real parts of the diagonal will be ignored.
7979
@@ -264,13 +264,13 @@ Base.conj!(A::HermOrSym) = typeof(A)(conj!(A.data), A.uplo)
264264
# tril/triu
265265
function tril(A::Hermitian, k::Integer=0)
266266
if A.uplo == 'U' && k <= 0
267-
return tril!(A.data',k)
267+
return tril!(adjoint(A.data),k)
268268
elseif A.uplo == 'U' && k > 0
269-
return tril!(A.data',-1) + tril!(triu(A.data),k)
269+
return tril!(adjoint(A.data),-1) + tril!(triu(A.data),k)
270270
elseif A.uplo == 'L' && k <= 0
271271
return tril(A.data,k)
272272
else
273-
return tril(A.data,-1) + tril!(triu!(A.data'),k)
273+
return tril(A.data,-1) + tril!(triu!(adjoint(A.data)),k)
274274
end
275275
end
276276

@@ -290,11 +290,11 @@ function triu(A::Hermitian, k::Integer=0)
290290
if A.uplo == 'U' && k >= 0
291291
return triu(A.data,k)
292292
elseif A.uplo == 'U' && k < 0
293-
return triu(A.data,1) + triu!(tril!(A.data'),k)
293+
return triu(A.data,1) + triu!(tril!(adjoint(A.data)),k)
294294
elseif A.uplo == 'L' && k >= 0
295-
return triu!(A.data',k)
295+
return triu!(adjoint(A.data),k)
296296
else
297-
return triu!(A.data',1) + triu!(tril(A.data),k)
297+
return triu!(adjoint(A.data),1) + triu!(tril(A.data),k)
298298
end
299299
end
300300

@@ -551,18 +551,18 @@ eigmax(A::RealHermSymComplexHerm{<:Real,<:StridedMatrix}) = eigvals(A, size(A, 1
551551
eigmin(A::RealHermSymComplexHerm{<:Real,<:StridedMatrix}) = eigvals(A, 1:1)[1]
552552

553553
function eigfact!(A::HermOrSym{T,S}, B::HermOrSym{T,S}) where {T<:BlasReal,S<:StridedMatrix}
554-
vals, vecs, _ = LAPACK.sygvd!(1, 'V', A.uplo, A.data, B.uplo == A.uplo ? B.data : B.data')
554+
vals, vecs, _ = LAPACK.sygvd!(1, 'V', A.uplo, A.data, B.uplo == A.uplo ? B.data : adjoint(B.data))
555555
GeneralizedEigen(vals, vecs)
556556
end
557557
function eigfact!(A::Hermitian{T,S}, B::Hermitian{T,S}) where {T<:BlasComplex,S<:StridedMatrix}
558-
vals, vecs, _ = LAPACK.sygvd!(1, 'V', A.uplo, A.data, B.uplo == A.uplo ? B.data : B.data')
558+
vals, vecs, _ = LAPACK.sygvd!(1, 'V', A.uplo, A.data, B.uplo == A.uplo ? B.data : adjoint(B.data))
559559
GeneralizedEigen(vals, vecs)
560560
end
561561

562562
eigvals!(A::HermOrSym{T,S}, B::HermOrSym{T,S}) where {T<:BlasReal,S<:StridedMatrix} =
563-
LAPACK.sygvd!(1, 'N', A.uplo, A.data, B.uplo == A.uplo ? B.data : B.data')[1]
563+
LAPACK.sygvd!(1, 'N', A.uplo, A.data, B.uplo == A.uplo ? B.data : adjoint(B.data))[1]
564564
eigvals!(A::Hermitian{T,S}, B::Hermitian{T,S}) where {T<:BlasComplex,S<:StridedMatrix} =
565-
LAPACK.sygvd!(1, 'N', A.uplo, A.data, B.uplo == A.uplo ? B.data : B.data')[1]
565+
LAPACK.sygvd!(1, 'N', A.uplo, A.data, B.uplo == A.uplo ? B.data : adjoint(B.data))[1]
566566

567567
eigvecs(A::HermOrSym) = eigvecs(eigfact(A))
568568

base/linalg/triangular.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,13 @@ function eigvecs(A::UnitUpperTriangular{<:BlasFloat,<:StridedMatrix})
590590
LAPACK.trevc!('R', 'A', BlasInt[], triu!(A.data))
591591
end
592592
function eigvecs(A::LowerTriangular{<:BlasFloat,<:StridedMatrix})
593-
LAPACK.trevc!('L', 'A', BlasInt[], tril!(A.data)')
593+
LAPACK.trevc!('L', 'A', BlasInt[], adjoint(tril!(A.data)))
594594
end
595595
function eigvecs(A::UnitLowerTriangular{<:BlasFloat,<:StridedMatrix})
596596
for i = 1:size(A, 1)
597597
A.data[i,i] = 1
598598
end
599-
LAPACK.trevc!('L', 'A', BlasInt[], tril!(A.data)')
599+
LAPACK.trevc!('L', 'A', BlasInt[], adjoint(tril!(A.data)))
600600
end
601601

602602
####################

base/operators.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ julia> inv(A) * x
500500
4.5
501501
```
502502
"""
503-
\(x,y) = (y'/x')'
503+
\(x,y) = adjoint(Adjoint(y)/Adjoint(x))
504504

505505
# Core <<, >>, and >>> take either Int or UInt as second arg. Signed shift
506506
# counts can shift in either direction, and are translated here to unsigned
@@ -739,7 +739,8 @@ fldmod1(x::T, y::T) where {T<:Real} = (fld1(x,y), mod1(x,y))
739739
# efficient version for integers
740740
fldmod1(x::T, y::T) where {T<:Integer} = (fld1(x,y), mod1(x,y))
741741

742-
# transpose
742+
# postfix apostophre
743+
Core.postfixapostrophize(x) = Adjoint(x)
743744

744745
"""
745746
adjoint(A)

base/pkg/resolve/maxsum.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ mutable struct Graph
122122
adjdict[p0][p1] = j1
123123

124124
bm = trues(spp[p1], spp[p0])
125-
bmt = bm'
125+
bmt = adjoint(bm)
126126

127127
push!(gmsk[p0], bm)
128128
push!(gmsk[p1], bmt)

base/rational.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function //(x::Rational, y::Rational)
5454
end
5555

5656
//(x::Complex, y::Real) = complex(real(x)//y,imag(x)//y)
57-
//(x::Number, y::Complex) = x*y'//abs2(y)
57+
//(x::Number, y::Complex) = x*conj(y)//abs2(y)
5858

5959

6060
//(X::AbstractArray, y::Number) = X .// y

base/sparse/linalg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ function cond(A::SparseMatrixCSC, p::Real=2)
580580
normA = norm(A, 1)
581581
return normA * normAinv
582582
elseif p == Inf
583-
normAinv = normestinv(A')
583+
normAinv = normestinv(adjoint(A))
584584
normA = norm(A, Inf)
585585
return normA * normAinv
586586
elseif p == 2

base/sparse/sparsevector.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ function LinAlg.lowrankupdate!(A::StridedMatrix, x::StridedVector, y::SparseVect
15531553
nzi = nonzeroinds(y)
15541554
nzv = nonzeros(y)
15551555
@inbounds for (j,v) in zip(nzi,nzv)
1556-
αv = α*v'
1556+
αv = α*conj(v)
15571557
for i in axes(x, 1)
15581558
A[i,j] += x[i]*αv
15591559
end

base/statistics.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ function cov2cor!(C::AbstractMatrix{T}, xsd::AbstractArray) where T
418418
size(C) == (nx, nx) || throw(DimensionMismatch("inconsistent dimensions"))
419419
for j = 1:nx
420420
for i = 1:j-1
421-
C[i,j] = C[j,i]'
421+
C[i,j] = adjoint(C[j,i])
422422
end
423423
C[j,j] = oneunit(T)
424424
for i = j+1:nx

src/julia-syntax.scm

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,22 +1515,6 @@
15151515
(kwcall-unless-empty f pa kw-container kw-container)
15161516
`(call (call (core kwfunc) ,f) ,kw-container ,f ,@pa)))))
15171517

1518-
;; convert e.g. A'*B to Ac_mul_B(A,B)
1519-
(define (expand-transposed-op e ops)
1520-
(let ((a (caddr e))
1521-
(b (cadddr e)))
1522-
(cond ((ctrans? a)
1523-
(if (ctrans? b)
1524-
`(call ,(aref ops 0) #;Ac_mul_Bc ,(expand-forms (cadr a))
1525-
,(expand-forms (cadr b)))
1526-
`(call ,(aref ops 1) #;Ac_mul_B ,(expand-forms (cadr a))
1527-
,(expand-forms b))))
1528-
((ctrans? b)
1529-
`(call ,(aref ops 2) #;A_mul_Bc ,(expand-forms a)
1530-
,(expand-forms (cadr b))))
1531-
(else
1532-
`(call ,(cadr e) ,(expand-forms a) ,(expand-forms b))))))
1533-
15341518
;; convert `a+=b` to `a=a+b`
15351519
(define (expand-update-operator- op op= lhs rhs declT)
15361520
(let ((e (remove-argument-side-effects lhs)))
@@ -2212,19 +2196,6 @@
22122196
((and (eq? f '^) (length= e 4) (integer? (cadddr e)))
22132197
(expand-forms
22142198
`(call (top literal_pow) ^ ,(caddr e) (call (call (core apply_type) (top Val) ,(cadddr e))))))
2215-
2216-
((and (eq? f '*) (length= e 4))
2217-
(expand-transposed-op
2218-
e
2219-
#(Ac_mul_Bc Ac_mul_B A_mul_Bc)))
2220-
((and (eq? f '/) (length= e 4))
2221-
(expand-transposed-op
2222-
e
2223-
#(Ac_rdiv_Bc Ac_rdiv_B A_rdiv_Bc)))
2224-
((and (eq? f '\\) (length= e 4))
2225-
(expand-transposed-op
2226-
e
2227-
#(Ac_ldiv_Bc Ac_ldiv_B A_ldiv_Bc)))
22282199
(else
22292200
(map expand-forms e))))
22302201
(map expand-forms e)))
@@ -2396,7 +2367,7 @@
23962367
,.(apply append rows)))
23972368
`(call (top typed_vcat) ,t ,@a)))))
23982369

2399-
'|'| (lambda (e) (expand-forms `(call adjoint ,(cadr e))))
2370+
'|'| (lambda (e) (expand-forms `(call (core postfixapostrophize) ,(cadr e))))
24002371
'|.'| (lambda (e) (begin (deprecation-message (string "The syntax `.'` for transposition is deprecated, "
24012372
"and the special lowering of `.'` in multiplication "
24022373
"(`*`), left-division (`\\`), and right-division (`/`) "

0 commit comments

Comments
 (0)