Skip to content
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

Triangular matrix indexing bug #15193

Closed
bkalpert opened this issue Feb 23, 2016 · 1 comment
Closed

Triangular matrix indexing bug #15193

bkalpert opened this issue Feb 23, 2016 · 1 comment

Comments

@bkalpert
Copy link
Contributor

Index ranges seem to fail with triangular matrices:

julia> s=randn(6,6); s = s*s'
6x6 Array{Float64,2}:
 12.6695    4.37903    3.78534   -1.82609   9.07167   1.5337  
  4.37903   4.03807    2.3878    -3.87199   2.81139  -0.362388
  3.78534   2.3878     3.7409    -2.44415   2.95657   0.558897
 -1.82609  -3.87199   -2.44415    8.43938  -2.7138    1.60016
  9.07167   2.81139    2.95657   -2.7138    7.78165   0.22353
  1.5337   -0.362388   0.558897   1.60016   0.22353   2.67511

julia> u=chol(s)
6x6 UpperTriangular{Float64,Array{Float64,2}}:
 3.55943  1.23026  1.06347   -0.513029   2.54863    0.430883
 0.0      1.58887  0.679383  -2.0397    -0.20398   -0.561711
 0.0      0.0      1.46573   -0.349872   0.262503   0.329038
 0.0      0.0      0.0        1.97317   -0.87701    0.400681
 0.0      0.0      0.0        0.0        0.637546  -1.13589
 0.0      0.0      0.0        0.0        0.0        0.784136

julia> u[3:5,6]
ERROR: ArgumentError: Triangular matrix must have two dimensions
 in similar at linalg/triangular.jl:27
 in _unsafe_getindex at multidimensional.jl:193
 in getindex at abstractarray.jl:488

This was in version 0.4, but the same error occurs in today's 0.5.

@tkelman
Copy link
Contributor

tkelman commented Feb 23, 2016

see #13731

andreasnoack added a commit that referenced this issue Feb 23, 2016
try to be consistent across the special matrices. Fixes #15193.
andreasnoack added a commit that referenced this issue Feb 23, 2016
try to be consistent across the special matrices. Fixes #15193.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants