Mercurial > repos > public > sbplib_julia
comparison src/Grids/grid.jl @ 1624:888e4092e2ed
Add missing type annotation in src/Grids/grid.jl for ArrayComponentView
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 11 Jun 2024 21:43:01 +0200 |
parents | b459082533f7 |
children | 5f348cc5598e b02917bcd7d5 |
comparison
equal
deleted
inserted
replaced
1623:07e8080c9f1a | 1624:888e4092e2ed |
---|---|
72 CT = typeof(first(v)[component_index...]) | 72 CT = typeof(first(v)[component_index...]) |
73 return new{CT, eltype(v), ndims(v), typeof(v), typeof(component_index)}(v,component_index) | 73 return new{CT, eltype(v), ndims(v), typeof(v), typeof(component_index)}(v,component_index) |
74 end | 74 end |
75 end | 75 end |
76 | 76 |
77 Base.size(cv) = size(cv.v) | 77 Base.size(cv::ArrayComponentView) = size(cv.v) |
78 Base.getindex(cv::ArrayComponentView, i::Int) = cv.v[i][cv.component_index...] | 78 Base.getindex(cv::ArrayComponentView, i::Int) = cv.v[i][cv.component_index...] |
79 Base.getindex(cv::ArrayComponentView, I::Vararg{Int}) = cv.v[I...][cv.component_index...] | 79 Base.getindex(cv::ArrayComponentView, I::Vararg{Int}) = cv.v[I...][cv.component_index...] |
80 IndexStyle(::Type{<:ArrayComponentView{<:Any,<:Any,AT}}) where AT = IndexStyle(AT) | 80 IndexStyle(::Type{<:ArrayComponentView{<:Any,<:Any,AT}}) where AT = IndexStyle(AT) |
81 | 81 |
82 # TODO: Implement `setindex!`? | 82 # TODO: Implement `setindex!`? |