Skip to content

Commit

Permalink
Merge pull request #249 from JuliaRobotics/23Q4/enh/miniclean
Browse files Browse the repository at this point in the history
mini cleanup
  • Loading branch information
dehann authored Oct 5, 2023
2 parents bd5c45c + 4b110aa commit 8bf8254
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
19 changes: 10 additions & 9 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,19 @@ function manifoldProduct( ff::AbstractVector{<:ManifoldKernelDensity},
## TODO check both _ff and inplace use a matrix of coordinates (columns)
# expects Matrix with columns as samples and rows are coordinate dimensions
pGM, = prodAppxMSGibbsS(inplace, _ff,
nothing, nothing, Niter=Niter,
partialDimMask=partialDimMask,
nothing, nothing;
Niter,
partialDimMask,
addop=addopT,
diffop=diffopT,
getMu=getManiMu,
glbs=glbs,
addEntropy=addEntropy,
ndims=ndims,
Ndens=Ndens,
Np=Np,
maxNp=maxNp,
Nlevels=Nlevels,
glbs,
addEntropy,
ndims,
Ndens,
Np,
maxNp,
Nlevels,
randU=_randU,
randN=_randN );
#
Expand Down
9 changes: 7 additions & 2 deletions src/services/ManifoldKernelDensity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,12 @@ Random.rand(mkd::ManifoldKernelDensity, N::Integer=1) = sample(mkd, N)[1]


function resample(x::ManifoldKernelDensity, N::Int)
pts, = sample(x, N)
pts = if N < Npts(x)
shuffle(getPoints(x))[1:N]
else
_pts, = sample(x, N)
_pts
end
ManifoldKernelDensity(x.manifold, pts, x._u0, partial=x._partial, infoPerCoord=x.infoPerCoord)
end

Expand Down Expand Up @@ -296,7 +301,7 @@ function antimarginal(newM::AbstractManifold,
ipc = zeros(manifold_dimension(newM))
ipc[finalpartial] .= getInfoPerCoord(mkd, true)

manikde!(newM, nPts, u0, bw=bw, partial=finalpartial, infoPerCoord=ipc)
manikde!(newM, nPts, u0; bw, partial=finalpartial, infoPerCoord=ipc)
end


Expand Down

0 comments on commit 8bf8254

Please sign in to comment.