Skip to content

Commit 83d5b65

Browse files
committed
Implement getindex for UntypedVarInfo
1 parent 18af48a commit 83d5b65

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/varinfo.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,10 @@ Return the current value(s) of the random variables sampled by `spl` in `vi`.
16941694
16951695
The value(s) may or may not be transformed to Euclidean space.
16961696
"""
1697+
function getindex(vi::UntypedVarInfo, spl::Sampler)
1698+
indices = _getranges(vi, spl)
1699+
return copy(vi.metadata.vals[indices])
1700+
end
16971701
getindex(vi::VarInfo, spl::Sampler) = copy(getindex_internal(vi, _getranges(vi, spl)))
16981702
function getindex(vi::TypedVarInfo, spl::Sampler)
16991703
# Gets the ranges as a NamedTuple

0 commit comments

Comments
 (0)