Skip to content

Commit a1a0801

Browse files
committed
Remove special lowering of ' in *, /, and \ expressions to A[c]_(mul|ldiv|rdiv)_B[c].
1 parent 0bd2c83 commit a1a0801

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

src/julia-syntax.scm

+1-30
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)))
@@ -2210,19 +2194,6 @@
22102194
((and (eq? f '^) (length= e 4) (integer? (cadddr e)))
22112195
(expand-forms
22122196
`(call (top literal_pow) ^ ,(caddr e) (call (call (core apply_type) (top Val) ,(cadddr e))))))
2213-
2214-
((and (eq? f '*) (length= e 4))
2215-
(expand-transposed-op
2216-
e
2217-
#(Ac_mul_Bc Ac_mul_B A_mul_Bc)))
2218-
((and (eq? f '/) (length= e 4))
2219-
(expand-transposed-op
2220-
e
2221-
#(Ac_rdiv_Bc Ac_rdiv_B A_rdiv_Bc)))
2222-
((and (eq? f '\\) (length= e 4))
2223-
(expand-transposed-op
2224-
e
2225-
#(Ac_ldiv_Bc Ac_ldiv_B A_ldiv_Bc)))
22262197
(else
22272198
(map expand-forms e))))
22282199
(map expand-forms e)))
@@ -2394,7 +2365,7 @@
23942365
,.(apply append rows)))
23952366
`(call (top typed_vcat) ,t ,@a)))))
23962367

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

test/linalg/dense.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ end
790790
@testset "/ and \\ consistency with pinv for vectors" begin
791791
@testset "Tests for type $elty" for elty in (Float32, Float64, ComplexF32, ComplexF64)
792792
c = rand(elty, 5)
793-
r = rand(elty, 5)'
793+
r = (elty <: Complex ? Adjoint : Transpose)(rand(elty, 5))
794794
cm = rand(elty, 5, 1)
795795
rm = rand(elty, 1, 5)
796796
@testset "inner prodcuts" begin

0 commit comments

Comments
 (0)