Fix inv for triangular and diagonal matrices
Merge pull request #3704 from JuliaLang/anj/fixinv

Fix inv for triangular and diagonal matrices