Skip to content

Commit

Permalink
Array inbounds_getindex (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty committed Apr 20, 2024
1 parent 576463f commit 87edc91
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ContinuumArrays"
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
version = "0.17.1"
version = "0.17.2"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
1 change: 1 addition & 0 deletions src/maps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ getindex(A::AbstractAffineQuasiVector, ::Colon) = copy(A)
copy(A::AbstractAffineQuasiVector) = A

inbounds_getindex(A::AbstractAffineQuasiVector{<:Any,<:Any,<:Inclusion}, k::Number) = A.A*k .+ A.b
inbounds_getindex(A::AbstractAffineQuasiVector{<:Number,<:Any,<:Inclusion}, k::AbstractArray{<:Number}) = A.A .* k .+ A.b
isempty(A::AbstractAffineQuasiVector) = isempty(A.x)
==(a::AbstractAffineQuasiVector, b::AbstractAffineQuasiVector) = a.A == b.A && a.x == b.x && a.b == b.b
==(a::AbstractAffineQuasiVector, b::Inclusion) = a == affine(b,b)
Expand Down
1 change: 1 addition & 0 deletions test/test_maps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import ContinuumArrays: AffineQuasiVector
@test union(y) == Inclusion(-1..1)
@test ContinuumArrays.inbounds_getindex(y,0.1) == y[0.1]
@test ContinuumArrays.inbounds_getindex(y,2.1) == 2*2.1 - 1
@test ContinuumArrays.inbounds_getindex(y, [2.1,2.2]) == 2*[2.1,2.2] .- 1

z = 1 .- x
@test minimum(z) == 0.0
Expand Down

2 comments on commit 87edc91

@dlfivefifty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/105290

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.17.2 -m "<description of version>" 87edc9100cfb4441b07bebe87c574e44c9b8432c
git push origin v0.17.2

Please sign in to comment.