Skip to content

Commit

Permalink
Merge pull request #33 from JuliaRobotics/hotfix/warnserrorsjl1
Browse files Browse the repository at this point in the history
removing errors and warnings also needed downstream
  • Loading branch information
dehann committed Oct 5, 2018
2 parents 569cd90 + bc44504 commit 39b4c33
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/BallTree01.jl
Expand Up @@ -359,9 +359,9 @@ function makeBallTree(_pointsMatrix::Array{Float64,2}, _weights::Array{Float64,1
end

function printBallTree(bt::BallTree)
@show round(bt.centers,15);
@show round(bt.weights,15);
@show round(bt.ranges,15);
@show round.(bt.centers,dims=15);
@show round.(bt.weights,dims=15);
@show round.(bt.ranges,dims=15);
@show bt.left_child;
@show bt.right_child;
@show bt.highest_leaf;
Expand Down
8 changes: 4 additions & 4 deletions src/BallTreeDensity01.jl
Expand Up @@ -311,10 +311,10 @@ end

function printBallTree(bd::BallTreeDensity, rnd=15)
printBallTree(bd.bt);
@show round(bd.means,rnd);
@show round(bd.bandwidth,rnd);
@show round(bd.bandwidthMin,rnd);
@show round(bd.bandwidthMax,rnd);
@show round.(bd.means,digits=rnd);
@show round.(bd.bandwidth,digits=rnd);
@show round.(bd.bandwidthMin,digits=rnd);
@show round.(bd.bandwidthMax,digits=rnd);

nothing
end
Expand Down
10 changes: 5 additions & 5 deletions src/DualTree01.jl
Expand Up @@ -394,7 +394,7 @@ function evalAvgLogL(bd1::BallTreeDensity, bd2::BallTreeDensity)
W = getWeights(bd2)
ind = findall(L.==0.0)
ll = nothing
if sum(findall(W[ind])) > 0
if sum(findall(x->x!=0, W[ind])) > 0
# println("evalAvgLogL -- in if")
ll=-Inf
else
Expand Down Expand Up @@ -595,24 +595,24 @@ end

function getKDERangeLinspace(bd::BallTreeDensity; extend::Float64=0.1, N::Int=201)
v = getKDERange(bd,extend=extend)
return range(v[1], stop=v[2], length=N) #linspace(v[1],v[2],N)
return range(v[1], stop=v[2], length=N)
end

function getKDEMax(p::BallTreeDensity;N=200)
m = zeros(p.bt.dims)
for i in 1:p.bt.dims
mm = marginal(p,[i])
rangeV = getKDERange(mm)
X = linspace(rangeV[1],rangeV[2],N)
X = range(rangeV[1],stop=rangeV[2],length=N)
# yV = evaluateDualTree(mm,X)
yV = mm(reshape(collect(X), 1, N)) # TODO should allow AbstractArray
m[i] = X[findfirst(yV,maximum(yV))]
m[i] = X[something(findfirst(isequal(maximum(yV)), yV), 0)] # findfirst(yV,maximum(yV))
end
return m
end

function getKDEMean(p::BallTreeDensity)
return vec(Statistics.mean(getPoints(p),2))
return vec(Statistics.mean(getPoints(p),dims=2))
end
function getKDEfit(p::BallTreeDensity; distribution=MvNormal)
fit(distribution, getPoints(p))
Expand Down
5 changes: 1 addition & 4 deletions src/KDE01.jl
Expand Up @@ -39,9 +39,6 @@ function getPoints(bd::BallTreeDensity)
return pts
end

function getType(bd::BallTreeDensity)
return 0
end

#s = zeros(dens.D,dens.N);
#s(:,double(dens.perm(dens.N + (1:dens.N)))+1) = dens.bandwidth(:,dens.N + (1:dens.N));
Expand Down Expand Up @@ -80,7 +77,7 @@ function marginal(bd::BallTreeDensity, ind::Array{Int,1})
p = kde!(pts[ind,:],sig[ind], wts)
end

function randKernel(N::Int, M::Int, t::Int)
function randKernel(N::Int, M::Int, ::Type{KernelDensityEstimate.GaussianKer}) #t::Int)
return randn(N,M)
end

Expand Down
1 change: 0 additions & 1 deletion src/KernelDensityEstimate.jl
Expand Up @@ -60,5 +60,4 @@ A Julia package for Kernel Density Estimation and approximations of their produc
"""


end
12 changes: 6 additions & 6 deletions src/MSGibbs01.jl
Expand Up @@ -252,14 +252,14 @@ function printGlbs(g::GbGlb, tag=Union{})
end
println("Ndim=$(g.Ndim), Ndens=$(g.Ndens), Nlevels=$(g.Nlevels), dNp=$(g.dNp), dNpts=$(g.dNpts)")
@show g.ind
@show round(g.particles,2)
@show round(g.variance,2)
@show round(g.p,2)
@show round(g.Malmost,2)
@show round(g.Calmost,2)
@show round.(g.particles, digits=2)
@show round.(g.variance, digits=2)
@show round.(g.p, digits=2)
@show round.(g.Malmost, digits=2)
@show round.(g.Calmost, digits=2)
@show g.levelList
@show g.levelListNew
@show round(g.newPoints,4)
@show round.(g.newPoints, digits=4)
@show g.newIndices
end

Expand Down

0 comments on commit 39b4c33

Please sign in to comment.