JuliaLang/julia — pull request #6821 by simonbyrne (2014-05-12 18:15:07+00:00)
Title: Make Cholesky factor always be Triangular. Fix odd transpose bug.

Extracting the factor of a `C::Cholesky` via `C[:U]`/`C[:L]` now returns a `Triangular` type (as `C[:UL]` already did).

I also made the `transpose(::Triangular)` to be copying: otherwise some very funny things happen:
```
julia> X = Triangular(randn(5,5),:U)
5x5 Triangular{Float64}:
1.55896 -0.918047 2.31604 -1.39669 -0.333412
0.0 -0.458574 -0.297727 0.249335 -0.00512459
0.0 0.0 -0.451148 0.687349 0.276854
0.0 0.0 0.0 0.369269 0.275956
0.0 0.0 0.0 0.0 -0.324809

julia> X'*X
5x5 Array{Float64,2}:
2.43036 0.0 0.0 0.0 0.0
0.0 0.21029 0.0 0.0 0.0
0.0 0.0 0.203535 0.0 0.0
0.0 0.0 0.0 0.136359 0.0
0.0 0.0 0.0 0.0 0.105501

julia> X
5x5 Triangular{Float64}:
1.55896 0.0 0.0 0.0 0.0
0.0 -0.458574 0.0 0.0 0.0
0.0 0.0 -0.451148 0.0 0.0
0.0 0.0 0.0 0.369269 0.0
0.0 0.0 0.0 0.0 -0.324809
```
Existing behaviour is still available via the (unexported) `transpose!` method.

cc: @andreasnoackjensen