Skip to content

Commit

Permalink
Simplify definitions of variate_form and value_support (#1347)
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Jun 15, 2021
1 parent dd75dcf commit 6c25150
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,9 @@ const ContinuousMultivariateDistribution = Distribution{Multivariate, Continuou
const DiscreteMatrixDistribution = Distribution{Matrixvariate, Discrete}
const ContinuousMatrixDistribution = Distribution{Matrixvariate, Continuous}

variate_form(::Type{Distribution{VF,VS}}) where {VF<:VariateForm,VS<:ValueSupport} = VF
variate_form(::Type{T}) where {T<:Distribution} = variate_form(supertype(T))
variate_form(::Type{<:Distribution{VF}}) where {VF} = VF

value_support(::Type{Distribution{VF,VS}}) where {VF<:VariateForm,VS<:ValueSupport} = VS
value_support(::Type{T}) where {T<:Distribution} = value_support(supertype(T))
value_support(::Type{<:Distribution{VF,VS}}) where {VF,VS} = VS

# allow broadcasting over distribution objects
# to be decided: how to handle multivariate/matrixvariate distributions?
Expand Down

0 comments on commit 6c25150

Please sign in to comment.