Skip to content

Commit 99def88

Browse files
Implement custom getindex for UntypedVarInfo (#704)
* Implement getindex for UntypedVarInfo * Format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 18af48a commit 99def88

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/varinfo.jl

+2
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,8 @@ 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+
getindex(vi::UntypedVarInfo, spl::Sampler) =
1698+
copy(getindex(vi.metadata.vals, _getranges(vi, spl)))
16971699
getindex(vi::VarInfo, spl::Sampler) = copy(getindex_internal(vi, _getranges(vi, spl)))
16981700
function getindex(vi::TypedVarInfo, spl::Sampler)
16991701
# Gets the ranges as a NamedTuple

0 commit comments

Comments
 (0)