From ac6186a870e28dcc45d14ea642a9195cb517010c Mon Sep 17 00:00:00 2001 From: dehann Date: Tue, 10 Aug 2021 19:54:53 -0400 Subject: [PATCH 1/6] std to TranslationGroup --- src/Legacy.jl | 2 +- src/entities/ManifoldDefinitions.jl | 8 ++++---- src/services/ManifoldPartials.jl | 4 ++-- test/testBasicManiProduct.jl | 4 ++-- test/testManifoldPartial.jl | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Legacy.jl b/src/Legacy.jl index 6810bc9..316e825 100644 --- a/src/Legacy.jl +++ b/src/Legacy.jl @@ -3,7 +3,7 @@ function _reducePartialManifoldElements(el::Symbol) if el == :Euclid - return Euclidean(1) + return TranslationGroup(1) elseif el == :Circular return Circle() end diff --git a/src/entities/ManifoldDefinitions.jl b/src/entities/ManifoldDefinitions.jl index 666e467..7bcc1b4 100644 --- a/src/entities/ManifoldDefinitions.jl +++ b/src/entities/ManifoldDefinitions.jl @@ -33,12 +33,12 @@ const _AMP_CIRCLE = Manifolds.Circle() # this is just wrong and needs to be fixed const Circle1 = Circle() -const Euclid = Euclidean(1) +const Euclid = TranslationGroup(1) const EuclideanManifold = Euclid -const Euclid2 = Euclidean(2) -const Euclid3 = Euclidean(3) -const Euclid4 = Euclidean(4) +const Euclid2 = TranslationGroup(2) +const Euclid3 = TranslationGroup(3) +const Euclid4 = TranslationGroup(4) # TODO if not easy simplification exists, then just deprecate this const SE2_Manifold = SpecialEuclidean(2) diff --git a/src/services/ManifoldPartials.jl b/src/services/ManifoldPartials.jl index 18d172a..a83ff77 100644 --- a/src/services/ManifoldPartials.jl +++ b/src/services/ManifoldPartials.jl @@ -53,7 +53,7 @@ end ## EXTRACT PARTIAL MANIFOLD -function getManifoldPartial(M::Euclidean{Tuple{N}}, +function getManifoldPartial(M::Union{<:Euclidean{Tuple{N}},<:TranslationGroup}, partial::AbstractVector{Int}, repr::_PartiableRepresentationFlat{T}=nothing, offset::Base.RefValue{Int}=Ref(0); @@ -63,7 +63,7 @@ function getManifoldPartial(M::Euclidean{Tuple{N}}, offset[] += manifold_dimension(M) len = sum(mask) repr_p = repr === nothing ? nothing : zeros(T,len) - return (Euclidean(len),repr_p) + return (TranslationGroup(len),repr_p) end function getManifoldPartial(M::Circle, diff --git a/test/testBasicManiProduct.jl b/test/testBasicManiProduct.jl index 3e9bc4d..c607728 100644 --- a/test/testBasicManiProduct.jl +++ b/test/testBasicManiProduct.jl @@ -19,8 +19,8 @@ pts1 = [[0.05*randn(2);0.75*randn()] for i in 1:N] pts2 = [[0.05*randn(2);0.75*randn()] for i in 1:N] -P1 = manikde!(Euclidean(3),pts1) -P2 = manikde!(Euclidean(3),pts2) +P1 = manikde!(TranslationGroup(3),pts1) +P2 = manikde!(TranslationGroup(3),pts2) P12 = P1*P2 diff --git a/test/testManifoldPartial.jl b/test/testManifoldPartial.jl index 3580759..130a673 100644 --- a/test/testManifoldPartial.jl +++ b/test/testManifoldPartial.jl @@ -9,16 +9,16 @@ using Manifolds ## -M = Euclidean(3) +M = TranslationGroup(3) -@test getManifoldPartial(M, [1;2;3])[1] == Euclidean(3) -@test getManifoldPartial(M, [2;3])[1] == Euclidean(2) +@test getManifoldPartial(M, [1;2;3])[1] == TranslationGroup(3) +@test getManifoldPartial(M, [2;3])[1] == TranslationGroup(2) -@test getManifoldPartial(M, [1;2;3], zeros(3))[1] == Euclidean(3) +@test getManifoldPartial(M, [1;2;3], zeros(3))[1] == TranslationGroup(3) @test isapprox( getManifoldPartial(M, [1;2;3], zeros(3))[2], zeros(3) ) -@test getManifoldPartial(M, [2;3], zeros(3))[1] == Euclidean(2) +@test getManifoldPartial(M, [2;3], zeros(3))[1] == TranslationGroup(2) @test isapprox( getManifoldPartial(M, [2;3], zeros(3))[2], zeros(2)) From 21c4a9b03af141c7d4b0a0d2edca7b1cb6cd2a80 Mon Sep 17 00:00:00 2001 From: dehann Date: Mon, 23 Aug 2021 09:58:17 -0400 Subject: [PATCH 2/6] api instead setPointPartial! --- src/Deprecated.jl | 8 ++++++++ src/Interface.jl | 14 +++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Deprecated.jl b/src/Deprecated.jl index 4a11d7f..f1f3045 100644 --- a/src/Deprecated.jl +++ b/src/Deprecated.jl @@ -4,6 +4,14 @@ ## Remove below before v0.6 ## ====================================================================================================== +@deprecate setPointsManiPartial!( Mdest::AbstractManifold, + dest, + Msrc::AbstractManifold, + src, + partial::AbstractVector{<:Integer}, + asPartial::Bool=true ) setPointsManiPartial!( Mdest, dest, Msrc, src, partial, asPartial=asPartial ) + + export productbelief """ diff --git a/src/Interface.jl b/src/Interface.jl index 6b98455..8e321dc 100644 --- a/src/Interface.jl +++ b/src/Interface.jl @@ -5,7 +5,7 @@ import Manifolds: identity_element export makeCoordsFromPoint, makePointFromCoords, getNumberCoords export identity_element -export setPointsManiPartial!, setPointsMani! +export setPointPartial!, setPointsMani! export replace # Deprecate in favor of TranslationGroup instead, also type piracy @@ -69,12 +69,12 @@ end # asPartial=true indicates that src coords are smaller than dest coords, and false implying src has dummy values in placeholder dimensions -function setPointsManiPartial!( Mdest::AbstractManifold, - dest, - Msrc::AbstractManifold, - src, - partial::AbstractVector{<:Integer}, - asPartial::Bool=true ) +function setPointPartial!(Mdest::AbstractManifold, + dest, + Msrc::AbstractManifold, + src, + partial::AbstractVector{<:Integer}, + asPartial::Bool=true ) # dest_ = AMP.makeCoordsFromPoint(Mdest,dest) From 64c2e08f8bf7a7807a9efa30b603743ec2d7325e Mon Sep 17 00:00:00 2001 From: dehann Date: Mon, 23 Aug 2021 14:43:14 -0400 Subject: [PATCH 3/6] fix depr --- src/Deprecated.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Deprecated.jl b/src/Deprecated.jl index f1f3045..48a18b2 100644 --- a/src/Deprecated.jl +++ b/src/Deprecated.jl @@ -9,7 +9,7 @@ Msrc::AbstractManifold, src, partial::AbstractVector{<:Integer}, - asPartial::Bool=true ) setPointsManiPartial!( Mdest, dest, Msrc, src, partial, asPartial=asPartial ) + asPartial::Bool=true ) setPointsManiPartial!( Mdest, dest, Msrc, src, partial, asPartial ) export productbelief From b3b70863ddd5df28e2d16c91d4a4599b7052473a Mon Sep 17 00:00:00 2001 From: dehann Date: Mon, 23 Aug 2021 14:48:01 -0400 Subject: [PATCH 4/6] fix depr --- src/Deprecated.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Deprecated.jl b/src/Deprecated.jl index 48a18b2..66260c3 100644 --- a/src/Deprecated.jl +++ b/src/Deprecated.jl @@ -9,7 +9,7 @@ Msrc::AbstractManifold, src, partial::AbstractVector{<:Integer}, - asPartial::Bool=true ) setPointsManiPartial!( Mdest, dest, Msrc, src, partial, asPartial ) + asPartial::Bool=true ) setPointPartial!( Mdest, dest, Msrc, src, partial, asPartial ) export productbelief From 15546501f6670f1607cf1d4b8bd34bbf32f95e7c Mon Sep 17 00:00:00 2001 From: dehann Date: Mon, 23 Aug 2021 14:49:18 -0400 Subject: [PATCH 5/6] fix --- src/services/ManifoldKernelDensity.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/ManifoldKernelDensity.jl b/src/services/ManifoldKernelDensity.jl index c34bd44..5855778 100644 --- a/src/services/ManifoldKernelDensity.jl +++ b/src/services/ManifoldKernelDensity.jl @@ -182,7 +182,7 @@ function antimarginal(newM::AbstractManifold, pts = getPoints(mkd, false) nPts = Vector{typeof(u0)}(undef, length(pts)) for (i,pt) in enumerate(pts) - nPts[i] = setPointsManiPartial!(newM, deepcopy(u0), mkd.manifold, pt, newpartial) + nPts[i] = setPointPartial!(newM, deepcopy(u0), mkd.manifold, pt, newpartial) end # also update metadata elements From 112adc62d0081176204c9dc47fbc6ebea748a570 Mon Sep 17 00:00:00 2001 From: Dehann Fourie <6412556+dehann@users.noreply.github.com> Date: Mon, 23 Aug 2021 14:52:26 -0400 Subject: [PATCH 6/6] bump v0.4.16 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4d4b4c6..c000181 100644 --- a/Project.toml +++ b/Project.toml @@ -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.15" +version = "0.4.16" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"