Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Oct 12, 2023

With this, views of sparse/structured arrays are printed with dots as well:

julia> D = Diagonal(1:4)
4×4 Diagonal{Int64, UnitRange{Int64}}:
 1      
   2    
     3  
       4

julia> view(D, 1:3, 1:3)
3×3 view(::Diagonal{Int64, UnitRange{Int64}}, 1:3, 1:3) with eltype Int64:
 1    
   2  
     3

julia> S = sparse([1,2,2,2,3], [1,1,2,2,4], [5, -19, 73, 12, -7])
3×4 SparseMatrixCSC{Int64, Int64} with 4 stored entries:
   5        
 -19  85     
          -7

julia> view(S, 1:3, 1:3)
3×3 view(::SparseMatrixCSC{Int64, Int64}, 1:3, 1:3) with eltype Int64:
   5     
 -19  85  
        

@jishnub jishnub added the arrays [a, r, r, a, y, s] label Oct 12, 2023
@jishnub jishnub force-pushed the jishnub/viewreplacedots branch from 7556630 to 2d60614 Compare October 13, 2023 05:40
@stevengj
Copy link
Member

LGTM. Could use a NEWS item?

@jishnub
Copy link
Member Author

jishnub commented Oct 16, 2023

Which header should the news entry be added under? "New language features"?

@ViralBShah
Copy link
Member

Usually LinearAlgebra has a section in NEWS.

@jishnub
Copy link
Member Author

jishnub commented Oct 17, 2023

Strictly speaking, this isn't a LinearAlgebra change, but a Base subarray one. I suppose most of the applications are in linear algebra, so including it in that section would make sense

@KristofferC
Copy link
Member

Feels a bit excessive with a NEWS item for this. I think it can just be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrays [a, r, r, a, y, s]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants