Skip to content

Commit

Permalink
fixed dispatch bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed Jul 18, 2023
1 parent ab86fb2 commit 8730268
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StaticVectors"
uuid = "20fadf95-9e3d-483c-97cd-cab2760e7998"
authors = ["Michael Reed"]
version = "1.0.2"
version = "1.0.3"

[deps]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
4 changes: 2 additions & 2 deletions src/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Base.@propagate_inbounds function Base.getindex(a::TupleVector{N}, ind::Union{In
end

function Base._getindex(::IndexStyle, A::AbstractVector, ind::TupleIndexing)
return AbstractTensors._getindex(A, index_sizes(unwrap(ind)), unwrap(ind))
return StaticVectors._getindex(A, index_sizes(unwrap(ind)), unwrap(ind))
end

@generated function _getindex(a::AbstractVector, ind_size::Val, ind)
Expand All @@ -195,7 +195,7 @@ end
end

function Base._setindex!(::IndexStyle, a::AbstractVector, value, ind::TupleIndexing)
return AbstractTensors._setindex!(a, value, index_sizes(ind), unwrap(ind))
return StaticVectors._setindex!(a, value, index_sizes(ind), unwrap(ind))
end

# setindex! from a scalar
Expand Down
4 changes: 4 additions & 0 deletions src/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
@inline Base.:*(a::Number, b::TupleVector{n,<:Number}) where n = map(c->Base.:*(a,c), b)
@inline Base.:*(a::TupleVector{n,<:Number}, b::Number) where n = map(c->Base.:*(c,b), a)

@inline Base.:*(a::Number, b::TupleVector) = broadcast(∏, a, b)
@inline Base.:*(a::TupleVector, b::Number) = broadcast(∏, a, b)
@inline Base.:*(a, b::TupleVector) = broadcast(∏, a, b)
@inline Base.:*(a::TupleVector, b) = broadcast(∏, a, b)

Expand All @@ -43,6 +45,8 @@
@inline Base.:/(a::TupleVector{n,<:Number}, b::Number) where n = broadcast(Base.:/, a, b)
@inline Base.:\(a::Number, b::TupleVector{n,<:Number}) where n = broadcast(Base.:\, a, b)

@inline Base.:/(a::TupleVector, b::Number) = broadcast(/, a, b)
@inline Base.:\(a::Number, b::TupleVector) = broadcast(\, a, b)
@inline Base.:/(a::TupleVector, b) = broadcast(/, a, b)
@inline Base.:\(a, b::TupleVector) = broadcast(\, a, b)

Expand Down

0 comments on commit 8730268

Please sign in to comment.