Skip to content

Commit 87edc91

Browse files
authored
Array inbounds_getindex (#174)
1 parent 576463f commit 87edc91

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ContinuumArrays"
22
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
3-
version = "0.17.1"
3+
version = "0.17.2"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/maps.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ getindex(A::AbstractAffineQuasiVector, ::Colon) = copy(A)
7474
copy(A::AbstractAffineQuasiVector) = A
7575

7676
inbounds_getindex(A::AbstractAffineQuasiVector{<:Any,<:Any,<:Inclusion}, k::Number) = A.A*k .+ A.b
77+
inbounds_getindex(A::AbstractAffineQuasiVector{<:Number,<:Any,<:Inclusion}, k::AbstractArray{<:Number}) = A.A .* k .+ A.b
7778
isempty(A::AbstractAffineQuasiVector) = isempty(A.x)
7879
==(a::AbstractAffineQuasiVector, b::AbstractAffineQuasiVector) = a.A == b.A && a.x == b.x && a.b == b.b
7980
==(a::AbstractAffineQuasiVector, b::Inclusion) = a == affine(b,b)

test/test_maps.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import ContinuumArrays: AffineQuasiVector
4949
@test union(y) == Inclusion(-1..1)
5050
@test ContinuumArrays.inbounds_getindex(y,0.1) == y[0.1]
5151
@test ContinuumArrays.inbounds_getindex(y,2.1) == 2*2.1 - 1
52+
@test ContinuumArrays.inbounds_getindex(y, [2.1,2.2]) == 2*[2.1,2.2] .- 1
5253

5354
z = 1 .- x
5455
@test minimum(z) == 0.0

0 commit comments

Comments
 (0)