Skip to content

Commit

Permalink
Fixed deep copy of Phi
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherRabotin committed Mar 15, 2017
1 parent 4dc999c commit c42b342
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hybrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ func (kf *HybridKF) fullUpdate(purePrediction bool, realObservation, computedObs
if err != nil {
return nil, err
}
est = &HybridKFEstimate{kf.Φ, kf.Γ, &xHat, realObservation, &innov, &y, PSym, PBarSym, &K}
Φ := *mat64.DenseCopyOf(kf.Φ)
var Γ *mat64.Dense
if kf.Γ != nil {
Γ = mat64.DenseCopyOf(kf.Γ)
}
est = &HybridKFEstimate{&Φ, Γ, &xHat, realObservation, &innov, &y, PSym, PBarSym, &K}
kf.prevEst = *est
kf.step++
kf.sncEnabled = false
Expand Down

0 comments on commit c42b342

Please sign in to comment.