JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.46k stars 5.46k forks source link

hessenberg/schur order of outputs #38440

Open RJDennis opened 3 years ago

RJDennis commented 3 years ago

Maybe there is a good reason for the current ordering, but otherwise I'd like to request that the schur function return its outputs in a different order.

The hessenberg function returns its outputs so that (v,s) = hessenberg(c) gives vsv' = c. In contrast, the schur function returns its outputs so that (u,r) = schur(c) gives rur' = c. The order that the hessenberg function returns its outputs seems more natural (to me), but consistency across the two functions would be nice.

stevengj commented 3 years ago

While I agree that it would have been better to be consistent, changing this would break backward compatibility so it probably can't happen in Julia 1.x.

Note also that this convention for schur and hessenberg is the same as the one followed by Matlab and Scipy, and there is some argument for following common linear-algebra software practices here even if they are counter-intuitive.