Skip to content

Commit

Permalink
Merge pull request #79 from agerlach/gd_dispatch
Browse files Browse the repository at this point in the history
fix dispatch for 4 argument `GenericDistribution`
  • Loading branch information
ChrisRackauckas authored Sep 6, 2022
2 parents b8865e4 + 20aa705 commit 441330b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/distribution_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct GenericDistribution{TF, TRF, TLB, TUB}
ub::TUB
end

function GenericDistribution(d, ds...)
function GenericDistribution(d::Distributions.Sampleable, ds...)
dists = (d, ds...)
pdf_func(x) = exp(sum(logpdf(f, y) for (f, y) in zip(dists, x)))
rand_func() = [rand(d) for d in dists]
Expand Down
2 changes: 1 addition & 1 deletion test/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function (sm::SystemMap{DT})(u0, p) where {DT}
end

@testset "GenericDistribution" begin
dists = (Uniform(1, 2), Uniform(3, 4), Normal(0, 1))
dists = (Uniform(1, 2), Uniform(3, 4), Normal(0, 1), truncated(Normal(0, 1), -3, 3))
x = [mean(d) for d in dists]

pdf_f = let dists = dists
Expand Down

0 comments on commit 441330b

Please sign in to comment.