Skip to content

Commit

Permalink
integer division should not change eltype
Browse files Browse the repository at this point in the history
  • Loading branch information
Jutho committed Aug 18, 2020
1 parent d9bbf33 commit a87c38c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tensors/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Base.:*(t::AbstractTensorMap, α::Number) =
mul!(similar(t, promote_type(eltype(t), typeof(α))), t, α)
Base.:*::Number, t::AbstractTensorMap) =
mul!(similar(t, promote_type(eltype(t), typeof(α))), α, t)
Base.:/(t::AbstractTensorMap, α::Number) = *(t, one(α)/α)
Base.:\::Number, t::AbstractTensorMap) = *(t, one(α)/α)
Base.:/(t::AbstractTensorMap, α::Number) = *(t, one(eltype(t))/α)
Base.:\::Number, t::AbstractTensorMap) = *(t, one(eltype(t))/α)

LinearAlgebra.normalize!(t::AbstractTensorMap, p::Real = 2) = rmul!(t, inv(norm(t, p)))
LinearAlgebra.normalize(t::AbstractTensorMap, p::Real = 2) =
Expand Down

0 comments on commit a87c38c

Please sign in to comment.