From 91280d18bd9dd8ef2295cd3b97e12a4b9dce3e7e Mon Sep 17 00:00:00 2001 From: dehann Date: Sat, 9 Jan 2021 21:43:18 -0500 Subject: [PATCH] general updates, bump v0.5.4 --- Project.toml | 2 +- src/KDE01.jl | 20 ++++++++++---------- src/MSGibbs01.jl | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Project.toml b/Project.toml index 8b11b9e..199f27b 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "KernelDensityEstimate" uuid = "2472808a-b354-52ea-a80e-1658a3c6056d" keywords = ["NBP", "nonparametric", "kernel density", "functional products", "multiscale", "Gibbs sampling", "KDE"] desc = "A modified version of the multiscale Gibbs product and KDE" -version = "0.5.3" +version = "0.5.4" [deps] DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" diff --git a/src/KDE01.jl b/src/KDE01.jl index 9806504..f43c59f 100644 --- a/src/KDE01.jl +++ b/src/KDE01.jl @@ -88,16 +88,16 @@ end Return the points (centers) used to construct the KDE. """ -function getPoints(bd::BallTreeDensity) - pts=zeros(bd.bt.dims, bd.bt.num_points) - perm = bd.bt.permutation[(bd.bt.num_points + 1):end] - bd.bt.num_points, bd.bt.dims - res = reshape(bd.bt.centers[(bd.bt.dims*bd.bt.num_points+1):end], bd.bt.dims, bd.bt.num_points) - ##for i in 1:bd.bt.dims - pts[:, perm ] = res[:,:] - ##end - pts = pts[:,1:bd.bt.num_points] - return pts +function getPoints(bd::BallTreeDensity, idx=1:bd.bt.num_points) + perm = bd.bt.permutation[(bd.bt.num_points + 1):end] + bd.bt.num_points, bd.bt.dims + res = reshape(bd.bt.centers[(bd.bt.dims*bd.bt.num_points+1):end], bd.bt.dims, bd.bt.num_points) + # return res[:,perm[idx]] + pts=zeros(bd.bt.dims, bd.bt.num_points) + pts[:, perm ] = res[:,:] + return pts[:,idx] + # pts = pts[:,idx] + # return pts end diff --git a/src/MSGibbs01.jl b/src/MSGibbs01.jl index 31d185b..d1906c9 100644 --- a/src/MSGibbs01.jl +++ b/src/MSGibbs01.jl @@ -31,7 +31,7 @@ mutable struct GbGlb recordChoosen::Bool end -function makeEmptyGbGlb() +function makeEmptyGbGlb(;recordChoosen::Bool=false) return GbGlb( zeros(0,0), zeros(0,0), zeros(0), @@ -52,7 +52,7 @@ function makeEmptyGbGlb() Float64[0.0;], Float64[0.0;], zeros(0), zeros(0), Dict{Int,Dict{Int,Dict{Int,Int}}}(), - false ) + recordChoosen ) end