-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new postfix transpose()
operator different from '
#35593
Comments
Ref #34507, JuliaLang/LinearAlgebra.jl#410 If you like, you can always do this: struct Transposer end
const ᵀ = Transposer() #typed \^T<TAB>
Base.:(*)(x, ::Transposer) = transpose(x) julia> rand(5)ᵀ*randn(5,5)*rand(5)
0.7409506780313673
julia> A = rand(5); (A)ᵀ*rand(5, 5)*A
2.7952114562233827 |
Yet the following does not work
And that is the point of having a built in operator, such that the parser will recognize |
It works if you surround julia> (z)ᵀ*z
1.4221674642522308 I should also reference this PR: #34549 where they run PkgEval to show what registered packages would be effected by changing the meaning of |
duplicate of JuliaLang/LinearAlgebra.jl#410 |
Isn't that already the case --- adjoint and transpose are equivalent for reals? |
Can we introduce a new postfix operator for the transpose, like
A^⊤
orA̕
?It would of great help to us who write expressions with a lot of transposes. For example:
and it would more true to form if the multiple calls to
transpose()
were replaced with something more terse. Even if the language defaulted to transpose forA'
unless it knew a complex data type was used when the adoint is more appropriate.The text was updated successfully, but these errors were encountered: