diff --git a/Project.toml b/Project.toml index a10d8044b..c809fedd9 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "IncrementalInference" uuid = "904591bb-b899-562f-9e6f-b8df64c7d480" keywords = ["MM-iSAMv2", "Bayes tree", "junction tree", "Bayes network", "variable elimination", "graphical models", "SLAM", "inference", "sum-product", "belief-propagation"] desc = "Implements the Multimodal-iSAMv2 algorithm." -version = "0.25.6" +version = "0.25.7" [deps] ApproxManifoldProducts = "9bbbb610-88a1-53cd-9763-118ce10c1f89" diff --git a/src/DefaultNodeTypes.jl b/src/DefaultNodeTypes.jl index db6b9a1d5..942f92373 100644 --- a/src/DefaultNodeTypes.jl +++ b/src/DefaultNodeTypes.jl @@ -4,12 +4,16 @@ """ $SIGNATURES -Hacky version to return which factor type to use between two variables of types T1 and T2. +Return a default factor type between two variables of types T1 and T2. -Pending work on RoME.jl #244 and IIF.jl #1010 and others, after which this will be refactored. +Notes +- Most likely used with deconvolution between target variables """ -selectFactorType(T1::InstanceType{ContinuousScalar}, T2::InstanceType{ContinuousScalar}) = LinearRelative{1} +selectFactorType(Modl::Module, T1::Type{<:InferenceVariable}, T2::Type{<:InferenceVariable}) = getfield(Modl, Symbol(T1, T2)) +selectFactorType(T1::Type{<:InferenceVariable}, T2::Type{<:InferenceVariable}) = selectFactorType(typeof(T1()).name.module, T1, T2) +selectFactorType(T1::Type{<:ContinuousScalar}, T2::Type{<:ContinuousScalar}) = LinearRelative{1} selectFactorType(T1::Type{<:ContinuousEuclid{N}}, T2::Type{<:ContinuousEuclid{N}}) where N = LinearRelative{N} selectFactorType(T1::InferenceVariable, T2::InferenceVariable) = selectFactorType(typeof(T1), typeof(T2)) selectFactorType(dfg::AbstractDFG, s1::Symbol, s2::Symbol) = selectFactorType( getVariableType(dfg, s1), getVariableType(dfg, s2) ) +# \ No newline at end of file