Skip to content

Commit

Permalink
Merge d00d864 into 60c9098
Browse files Browse the repository at this point in the history
  • Loading branch information
staticfloat committed Jan 25, 2019
2 parents 60c9098 + d00d864 commit e1aac32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/partials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Base.convert(::Type{Partials{N,V}}, partials::Partials{N,V}) where {N,V} = parti
@inline Base.:-(a::Partials{N}, b::Partials{N}) where {N} = Partials(sub_tuples(a.values, b.values))
@inline Base.:-(partials::Partials) = Partials(minus_tuple(partials.values))
@inline Base.:*(x::Real, partials::Partials) = partials*x
@inline Base.:*(x, partials::Partials) = partials*x

@inline function _div_partials(a::Partials, b::Partials, aval, bval)
return _mul_partials(a, b, inv(bval), -(aval / (bval*bval)))
Expand Down Expand Up @@ -110,6 +111,9 @@ else
@inline function Base.:*(partials::Partials, x::Real)
return Partials(scale_tuple(partials.values, x))
end
@inline function Base.:*(partials::Partials, x)
return Partials(scale_tuple(partials.values, x))
end

@inline function Base.:/(partials::Partials, x::Real)
return Partials(div_tuple_by_scalar(partials.values, x))
Expand Down

0 comments on commit e1aac32

Please sign in to comment.