Skip to content

Commit

Permalink
Default getSample methods for group manifolds
Browse files Browse the repository at this point in the history
  • Loading branch information
Affie committed Nov 1, 2021
1 parent adbe12a commit f80fa36
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/ManifoldSampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,15 @@ function samplePoint(distr::SamplableBelief)
end

## default getSample
# getSample(cf::CalcFactor{<:AbstractPrior}, N::Int=1) = ([samplePoint(getManifold(cf.factor), cf.factor.Z, ) for _=1:N], )
# getSample(cf::CalcFactor{<:AbstractRelative}, N::Int=1) = ([sampleTangent(getManifold(cf.factor), cf.factor.Z) for _=1:N], )

function getSample(cf::CalcFactor{<:AbstractPrior})
M = getManifold(cf.factor)
X = samplePoint(M, cf.factor.Z)
return X
end

function getSample(cf::CalcFactor{<:AbstractManifoldMinimize})
M = getManifold(cf.factor)
X = sampleTangent(M, cf.factor.Z)
return X
end

0 comments on commit f80fa36

Please sign in to comment.