From 0888e9046a653bf43c0021c40038f1d3efa3f5ea Mon Sep 17 00:00:00 2001 From: Johannes Terblanche Date: Mon, 16 Oct 2023 16:20:48 +0200 Subject: [PATCH] fix deconv and mixture --- src/Factors/Mixture.jl | 3 ++- src/services/DeconvUtils.jl | 5 +---- src/services/NumericalCalculations.jl | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Factors/Mixture.jl b/src/Factors/Mixture.jl index c811f5d7..0941f311 100644 --- a/src/Factors/Mixture.jl +++ b/src/Factors/Mixture.jl @@ -126,7 +126,8 @@ function sampleFactor(cf::CalcFactor{<:Mixture}, N::Int = 1) cf.cache, cf.fullvariables, cf.solvefor, - cf.manifold + cf.manifold, + cf.measurement ) smpls = [getSample(cf_) for _ = 1:N] # smpls = Array{Float64,2}(undef,s.dims,N) diff --git a/src/services/DeconvUtils.jl b/src/services/DeconvUtils.jl index 19d66077..40ebf20d 100644 --- a/src/services/DeconvUtils.jl +++ b/src/services/DeconvUtils.jl @@ -71,9 +71,6 @@ function approxDeconv( islen1 = zDim == 1 - # FIXME, is this still in use - destVarVals = Vector{Int}() - for idx = 1:N # towards each particle in their own thread (not 100% ready yet, factors should be separate memory) target_smpl = makeTarget(idx) @@ -82,7 +79,7 @@ function approxDeconv( resize!(ccw.hyporecipe.activehypo, length(hyporecipe.activehypo[2][2])) ccw.hyporecipe.activehypo[:] = hyporecipe.activehypo[2][2] - onehypo!, _ = _buildCalcFactorLambdaSample(ccw, idx, target_smpl, measurement) + onehypo! = _buildCalcFactorLambdaSample(ccw, idx, measurement) # # lambda with which to find best measurement values diff --git a/src/services/NumericalCalculations.jl b/src/services/NumericalCalculations.jl index 018a0536..6c6a7b85 100644 --- a/src/services/NumericalCalculations.jl +++ b/src/services/NumericalCalculations.jl @@ -74,7 +74,7 @@ end # struct OptimCalcConv end # CalcFactorNormSq cost function for an input in coordinates as used by Optim.jl function (hypoCalcFactor::CalcFactorNormSq)(M::AbstractManifold, Xc::AbstractVector) - # M = hypoCalcFactor.manifold # calc factor has factor manifold in not variable that is needed here + # hypoCalcFactor.manifold is the factor's manifold, not the variable's manifold that is needed here ϵ = getPointIdentity(M) X = get_vector(M, ϵ, Xc, DefaultOrthogonalBasis()) p = exp(M, ϵ, X)