Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
willow-ahrens committed May 21, 2024
1 parent e91b15c commit a5647d5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/util/vectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ struct PlusOneVector{T, A <: AbstractVector{T}} <: AbstractVector{T}
data::A
end

PlusOneVector(data::AbstractVector{T}) where {T} = PlusOneVector{T, typeof(data)}(data)

@propagate_inbounds function Base.getindex(vec::PlusOneVector{T},
index::Int) where {T}
return vec.data[index] + 0x01
Expand Down Expand Up @@ -36,11 +38,11 @@ function moveto(vec::PlusOneVector{T}, device) where {T}
return PlusOneVector{T}(data)
end

struct MinusEpsVector{T, S} <: AbstractVector{T}
data::AbstractVector{S}
struct MinusEpsVector{T, S, A <: AbstractVector{S}} <: AbstractVector{T}
data::A
end

MinusEpsVector(data::AbstractVector{T}) where {T} = MinusEpsVector{Limit{T}, T}(data)
MinusEpsVector(data::AbstractVector{T}) where {T} = MinusEpsVector{Limit{T}, T, typeof(data)}(data)

@propagate_inbounds function Base.getindex(vec::MinusEpsVector{T},
index::Int) where {T}
Expand Down Expand Up @@ -80,11 +82,11 @@ function moveto(vec::MinusEpsVector{T}, device) where {T}
return MinusEpsVector{T}(data)
end

struct PlusEpsVector{T, S} <: AbstractVector{T}
data::AbstractVector{S}
struct PlusEpsVector{T, S, A <:AbstractVector{S}} <: AbstractVector{T}
data::A
end

PlusEpsVector(data::AbstractVector{T}) where {T} = PlusEpsVector{Limit{T}, T}(data)
PlusEpsVector(data::AbstractVector{T}) where {T} = PlusEpsVector{Limit{T}, T, typeof(data)}(data)

@propagate_inbounds function Base.getindex(vec::PlusEpsVector{T},
index::Int) where {T}
Expand Down

0 comments on commit a5647d5

Please sign in to comment.