@@ -504,7 +504,6 @@ function _beforeSolveCCW!(
504
504
F_:: Type{<:AbstractRelative} ,
505
505
ccwl:: CommonConvWrapper{F} ,
506
506
variables:: AbstractVector{<:DFGVariable} ,
507
- # destVarVals::AbstractVector,
508
507
sfidx:: Int ,
509
508
N:: Integer ;
510
509
measurement = Vector {Tuple{}} (),
@@ -519,46 +518,27 @@ function _beforeSolveCCW!(
519
518
end
520
519
521
520
# in forward solve case, important to set which variable is being solved early in this sequence
521
+ # set the 'solvefor' variable index -- i.e. which connected variable of the factor is being computed in this convolution.
522
522
ccwl. varidx[] = sfidx
523
+ # ccwl.varidx[] = findfirst(==(solvefor), getLabel.(variables))
523
524
524
- # TBD, order of fmd ccwl cf are a little weird and should be revised.
525
525
# TODO , maxlen should parrot N (barring multi-/nullhypo issues)
526
- # set the 'solvefor' variable index -- i.e. which connected variable of the factor is being computed in this convolution.
527
- # ccwl.varidx[] = findfirst(==(solvefor), getLabel.(variables))
528
526
# everybody use maxlen number of points in belief function estimation
529
527
maxlen = maximum ((N, length .(ccwl. varValsAll[])... ,))
530
528
531
- # splice
532
- # should be type stable
529
+ # splice, type stable
530
+ # make deepcopy of destination variable since multiple approxConv type computations should happen from different factors to the same variable
533
531
tvarv = tuple (
534
532
map (s-> getVal (s; solveKey), variables[1 : sfidx- 1 ])... ,
535
- deepcopy (ccwl . varValsAll[][ sfidx]) , # destVarVals = deepcopy(ccwl.varValsAll[][sfidx])
533
+ deepcopy (getVal (variables[ sfidx]; solveKey)) , # deepcopy(ccwl.varValsAll[][sfidx]),
536
534
map (s-> getVal (s; solveKey), variables[sfidx+ 1 : end ])... ,
537
- )
538
- # not type-stable
539
- # varvals = [getVal(s; solveKey) for s in variables]
540
- # varvals[sfidx] = destVarVals
541
- # varvals_ = [varvals[1:sfidx-1]..., destVarVals, varvals[sfidx+1:end]...]
542
- # tvarv = tuple(varvals...)
543
-
544
-
545
- # @info "TYPES" typeof(ccwl.varValsAll[]) typeof(tvarv)
535
+ )
546
536
ccwl. varValsAll[] = tvarv
547
- # ccwl.varValsAll[] = map(s->getVal(s; solveKey), tuple(variables...))
548
- # # PLAN B, make deep copy of ccwl.varValsAll[ccwl.varidx[]] just before the numerical solve
549
-
550
- # maxlen, ccwl.varidx[] = _updateParamVec(variables, solvefor, ccwl.varValsAll, N; solveKey)
551
- # # TODO , ensure all values (not just multihypothesis) is correctly used from here
552
- # for (i,varVal) in enumerate(_varValsAll)
553
- # resize!(ccwl.varValsAll[i],length(varVal))
554
- # ccwl.varValsAll[i][:] = varVal #TODO Kyk hierna: this looks like it will effectively result in vnd.val memory being overwritten
555
- # end
556
537
557
- # TODO better consolidation still possible
558
- # FIXME ON FIRE, what happens if this is a partial dimension factor? See #1246
559
- # FIXME , confirm this is hypo sensitive selection from variables, better to use double indevariablesng for clarity getDimension(ccw.fullvariables[hypoidx[ccwl.varidx[]]])
560
- xDim = getDimension (getVariableType (variables[ccwl. varidx[]])) # ccwl.varidx[]
561
- # ccwl.xDim = xDim
538
+
539
+ # FIXME , confirm what happens when this is a partial dimension factor? See #1246
540
+ # indexing over all possible hypotheses
541
+ xDim = getDimension (getVariableType (variables[ccwl. varidx[]]))
562
542
# TODO maybe refactor different type or api call?
563
543
564
544
# setup the partial or complete decision variable dimensions for this ccwl object
@@ -567,7 +547,6 @@ function _beforeSolveCCW!(
567
547
_setCCWDecisionDimsConv! (ccwl, xDim)
568
548
569
549
# FIXME do not divert Mixture for sampling
570
-
571
550
updateMeasurement! (ccwl, maxlen; needFreshMeasurements, measurement, _allowThreads= true )
572
551
573
552
# used in ccw functor for AbstractRelativeMinimize
@@ -584,7 +563,6 @@ function _beforeSolveCCW!(
584
563
F_:: Type{<:AbstractPrior} ,
585
564
ccwl:: CommonConvWrapper{F} ,
586
565
variables:: AbstractVector{<:DFGVariable} ,
587
- # destVarVals::AbstractVector,
588
566
sfidx:: Int ,
589
567
N:: Integer ;
590
568
measurement = Vector {Tuple{}} (),
@@ -594,12 +572,7 @@ function _beforeSolveCCW!(
594
572
# FIXME , NEEDS TO BE CLEANED UP AND WORK ON MANIFOLDS PROPER
595
573
596
574
ccwl. varidx[] = sfidx
597
- # fnc = ccwl.usrfnc!
598
- # sfidx = findfirst(getLabel.(variables) .== solvefor)
599
575
@assert ccwl. varidx[] == 1 " Solving on Prior with CCW should have sfidx=1, priors are unary factors."
600
- # @assert sfidx == 1 "Solving on Prior with CCW should have sfidx=1, priors are unary factors."
601
- # ccwl.varidx[] = sfidx
602
- # sfidx = 1 # why hardcoded to 1, maybe for only the AbstractPrior case here
603
576
604
577
# setup the partial or complete decision variable dimensions for this ccwl object
605
578
# NOTE perhaps deconv has changed the decision variable list, so placed here during consolidation phase
0 commit comments