Skip to content

Commit

Permalink
Merge pull request #120 from JuliaRobotics/21Q3/enh/fixes
Browse files Browse the repository at this point in the history
fix rand for ManifoldKernelDensity
  • Loading branch information
dehann committed Jul 23, 2021
2 parents 3bd7b83 + 407c16f commit 3d73a9f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ApproxManifoldProducts"
uuid = "9bbbb610-88a1-53cd-9763-118ce10c1f89"
keywords = ["MM-iSAMv2", "SLAM", "inference", "sum-product", "belief-propagation", "nonparametric", "manifolds", "functional"]
version = "0.4.8"
version = "0.4.9"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
1 change: 0 additions & 1 deletion src/Legacy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ Ndim(x::ManifoldKernelDensity, w...;kw...) = Ndim(x.belief,w...;kw...)
Npts(x::ManifoldKernelDensity, w...;kw...) = Npts(x.belief,w...;kw...)

getWeights(x::ManifoldKernelDensity, w...;kw...) = getWeights(x.belief, w...;kw...)
Random.rand(x::ManifoldKernelDensity, d::Integer=1) = rand(x.belief, d)

getKDERange(x::ManifoldKernelDensity, w...;kw...) = getKDERange(x.belief, w...;kw...)
getKDEMax(x::ManifoldKernelDensity, w...;kw...) = getKDEMax(x.belief, w...;kw...)
Expand Down
3 changes: 3 additions & 0 deletions src/services/ManifoldKernelDensity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ function sample(x::ManifoldKernelDensity{M,B,L,P}, N::Int) where {M,B,L,P}
vecP, lbls
end

Random.rand(mkd::ManifoldKernelDensity, N::Integer=1) = sample(mkd, N)[1]



function resample(x::ManifoldKernelDensity, N::Int)
pts, = sample(x, N)
Expand Down

0 comments on commit 3d73a9f

Please sign in to comment.