@@ -6,20 +6,22 @@ using Distributions: Univariate, Multivariate, Matrixvariate
6
6
Base type for distribution wrappers.
7
7
"""
8
8
abstract type WrappedDistribution{variate,support,Td<: Distribution{variate,support} } < :
9
- Distribution{variate,support}
9
+ Distribution{variate,support}
10
10
end
11
11
12
- wrapped_dist_type (:: Type{<:WrappedDistribution{<:Any,<:Any,Td}} ) where Td = Td
12
+ wrapped_dist_type (:: Type{<:WrappedDistribution{<:Any,<:Any,Td}} ) where {Td} = Td
13
13
wrapped_dist_type (d:: WrappedDistribution ) = wrapped_dist_type (d)
14
14
15
15
wrapped_dist (d:: WrappedDistribution ) = d. dist
16
16
17
17
Base. length (d:: WrappedDistribution{<:Multivariate} ) = length (wrapped_dist (d))
18
18
Base. size (d:: WrappedDistribution{<:Multivariate} ) = size (wrapped_dist (d))
19
- Base. eltype (:: Type{T} ) where T <: WrappedDistribution = eltype (wrapped_dist_type (T))
19
+ Base. eltype (:: Type{T} ) where {T <: WrappedDistribution } = eltype (wrapped_dist_type (T))
20
20
Base. eltype (d:: WrappedDistribution ) = eltype (wrapped_dist_type (d))
21
21
22
- Distributions. rand (rng:: Random.AbstractRNG , d:: WrappedDistribution ) = rand (rng, wrapped_dist (d))
22
+ function Distributions. rand (rng:: Random.AbstractRNG , d:: WrappedDistribution )
23
+ rand (rng, wrapped_dist (d))
24
+ end
23
25
Distributions. minimum (d:: WrappedDistribution ) = minimum (wrapped_dist (d))
24
26
Distributions. maximum (d:: WrappedDistribution ) = maximum (wrapped_dist (d))
25
27
0 commit comments