Skip to content

Commit 60dc8c1

Browse files
author
Frankie Robertson
committed
Get rid of lambda in TrackedLikelihoodIntegrator
1 parent 5025615 commit 60dc8c1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/aggregators/integrators.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ function (product::FunctionProduct)(x::T) where {T}
77
product.f(x) * product.lh_function(x)
88
end
99

10+
struct FunctionArgProduct{F}
11+
f::F
12+
end
13+
14+
function (product::FunctionArgProduct)(x::A, y::B) where {A, B}
15+
product.f(x) * y
16+
end
17+
1018
struct TrackedLikelihoodIntegrator{IntegratorT <: Integrator} <: AbilityIntegrator
1119
integrator::IntegratorT
1220
tracker::GriddedAbilityTracker
@@ -16,7 +24,7 @@ function(integrator::TrackedLikelihoodIntegrator{IntegratorT})(
1624
f::F,
1725
ncomp
1826
) where {F, IntegratorT}
19-
integrator.integrator((x, y) -> f(x) * y, integrator.tracker.cur_ability, ncomp)
27+
integrator.integrator(FunctionArgProduct(f), integrator.tracker.cur_ability, ncomp)
2028
end
2129

2230
struct FunctionIntegrator{IntegratorT <: Integrator} <: AbilityIntegrator

0 commit comments

Comments
 (0)