Skip to content

Commit

Permalink
tweaks and updates Mtree
Browse files Browse the repository at this point in the history
  • Loading branch information
dehann committed Sep 4, 2023
1 parent 3ec80c5 commit 5efed8d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/ApproxManifoldProducts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using Distributions

import Random: rand

import Base: *, isapprox, convert
import Base: *, isapprox, convert, show
import LinearAlgebra: rotate!
import Statistics: mean, std, cov, var
import KernelDensityEstimate: getPoints, getBW
Expand Down
18 changes: 10 additions & 8 deletions src/services/ManellicTree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,29 @@

# Short for Manifold Ellipse Metric Tree
# starting as a balanced tree, relax to unbalanced in future.
struct ManellicTree{M,H,D<:AbstractVector,N}
struct ManellicTree{M,D<:AbstractVector,N,HL,HT}
manifold::M
data::D
permute::MVector{N,Int}
leaf_kernels::MVector{N,H}
tree_kernels::MVector{N,H}
leaf_kernels::MVector{N,HL}
tree_kernels::MVector{N,HT}
left_idx::MVector{N,Int}
right_idx::MVector{N,Int}
end


function Base.show(io::IO, mt::ManellicTree{M,H,D,N}) where {M,H,D,N}
function Base.show(io::IO, mt::ManellicTree{M,D,N,HL,HT}) where {M,D,N,HL,HT}
printstyled(io, "ManellicTree{"; bold=true,color = :blue)
println(io)
printstyled(io, " M = ", M, color = :magenta)
printstyled(io, " M = ", M, color = :magenta)
println(io)
printstyled(io, " H = ", H, color = :magenta)
printstyled(io, " D = ", D, color = :magenta)
println(io)
printstyled(io, " D = ", D, color = :magenta)
printstyled(io, " N = ", N, color = :magenta)
println(io)
printstyled(io, " N = ", N, color = :magenta)
printstyled(io, " HL = ", HL, color = :magenta)
println(io)
printstyled(io, " HT = ", HT, color = :magenta)
println(io)
printstyled(io, "}", bold=true, color = :blue)
println(io, "(")
Expand Down
5 changes: 4 additions & 1 deletion test/manellic/testManellicTree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ end
##

M = TranslationGroup(2)
r_CC, R, pidx, r_CV = testEigenCoords(pi/3);
α = pi/3
r_CC, R, pidx, r_CV = testEigenCoords(α);
ax_CCp, mask, knl = splitPointsEigen(M, r_CC)
@test sum(mask) == (length(r_CC) ÷ 2)
@test knl isa MvNormal
Mr = SpecialOrthogonal(2)
@test isapprox( α, vee(Mr, Identity(Mr), log_lie(Mr, R))[1] ; atol=0.1)

# using GLMakie
# fig = Figure()
Expand Down

0 comments on commit 5efed8d

Please sign in to comment.