Skip to content

Commit 7d75aa0

Browse files
committed
Use type parameters
1 parent 6f670c4 commit 7d75aa0

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/logdensityfunction.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,19 @@ function logdensity_at(
183183
end
184184

185185
"""
186-
LogDensityAt(
187-
x::AbstractVector,
188-
model::Model,
189-
varinfo::AbstractVarInfo,
190-
context::AbstractContext
186+
LogDensityAt{M<:Model,V<:AbstractVarInfo,C<:AbstractContext}(
187+
model::M
188+
varinfo::V
189+
context::C
191190
)
192191
193192
A callable struct that serves the same purpose as `x -> logdensity_at(x, model,
194193
varinfo, context)`.
195194
"""
196-
struct LogDensityAt
197-
model::Model
198-
varinfo::AbstractVarInfo
199-
context::AbstractContext
195+
struct LogDensityAt{M<:Model,V<:AbstractVarInfo,C<:AbstractContext}
196+
model::M
197+
varinfo::V
198+
context::C
200199
end
201200
function (ld::LogDensityAt)(x::AbstractVector)
202201
varinfo_new = unflatten(ld.varinfo, x)

0 commit comments

Comments
 (0)