Changeset 11051 in ntrip
- Timestamp:
- Sep 28, 2026, 9:55:30 PM (7 hours ago)
- Location:
- trunk/BNC/src/PPP
- Files:
-
- 3 edited
-
pppClient.cpp (modified) (1 diff)
-
pppFilter.cpp (modified) (2 diffs)
-
pppFilter.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppClient.cpp
r11041 r11051 592 592 catch (Exception& exc) { 593 593 LOG << exc.what() << endl; 594 // A failed Kalman update (e.g. non-positive-definite covariance) leaves 595 // the filter state unusable and would be carried into every subsequent 596 // epoch => restart the filter, keeping ephemerides and corrections 597 // ---------------------------------------------------------------------- 598 LOG << string(_epoTimeRover) << " pppClient: filter reset after exception" << endl; 599 delete _filter; 600 _filter = new t_pppFilter(); 594 601 return finish(failure, 6); 595 602 } -
trunk/BNC/src/PPP/pppFilter.cpp
r10938 r11051 255 255 // Kalman update step 256 256 // ------------------ 257 kalman(AA, ll, PP, _QFlt, _xFlt); 257 try { 258 kalman(AA, ll, PP, _QFlt, _xFlt); 259 } 260 catch (Exception&) { 261 logNonPosDef(_QFlt, params); 262 throw; 263 } 258 264 259 265 // Check Residuals … … 319 325 } 320 326 return success; 327 } 328 329 // Diagnose a Variance-Covariance Matrix that failed Cholesky decomposition 330 //////////////////////////////////////////////////////////////////////////// 331 void t_pppFilter::logNonPosDef(const SymmetricMatrix& QQ, 332 const vector<t_pppParam*>& params) const { 333 334 string epoTimeStr = string(_epoTime); 335 int nn = QQ.Nrows(); 336 337 for (int ii = 1; ii <= nn; ii++) { 338 double qq = QQ(ii,ii); 339 if (!(qq > 0.0)) { 340 LOG << epoTimeStr << " NotPosDef diag " << params[ii-1]->toString() 341 << " Q = " << scientific << qq << fixed << endl; 342 } 343 } 344 345 // Cholesky pivots: first index where the matrix stops being positive definite 346 // --------------------------------------------------------------------------- 347 Matrix LL(nn, nn); LL = 0.0; 348 for (int jj = 1; jj <= nn; jj++) { 349 double sum = QQ(jj,jj); 350 for (int kk = 1; kk < jj; kk++) { 351 sum -= LL(jj,kk) * LL(jj,kk); 352 } 353 if (!(sum > 0.0)) { 354 const t_pppParam* par = params[jj-1]; 355 LOG << epoTimeStr << " NotPosDef pivot " << jj << " " << par->toString() 356 << " Q = " << scientific << QQ(jj,jj) << " pivot = " << sum 357 << fixed << " indexOld = " << par->indexOld() << endl; 358 for (int kk = 1; kk < jj; kk++) { 359 double rho = QQ(jj,kk) / sqrt(QQ(jj,jj) * QQ(kk,kk)); 360 if (fabs(rho) > 0.999) { 361 LOG << epoTimeStr << " NotPosDef corr " << params[kk-1]->toString() 362 << ' ' << setprecision(9) << rho << endl; 363 } 364 } 365 return; 366 } 367 LL(jj,jj) = sqrt(sum); 368 for (int ii = jj + 1; ii <= nn; ii++) { 369 double hlp = QQ(ii,jj); 370 for (int kk = 1; kk < jj; kk++) { 371 hlp -= LL(ii,kk) * LL(jj,kk); 372 } 373 LL(ii,jj) = hlp / LL(jj,jj); 374 } 375 } 321 376 } 322 377 -
trunk/BNC/src/PPP/pppFilter.h
r10805 r11051 81 81 const std::vector<t_pppSatObs*>& obsVector); 82 82 83 void logNonPosDef(const SymmetricMatrix& QQ, const std::vector<t_pppParam*>& params) const; 84 83 85 t_irc resetAmb(t_prn prn, const std::vector<t_pppSatObs*>& obsVector, t_lc lc, 84 86 SymmetricMatrix* QSav = 0, ColumnVector* xSav = 0);
Note:
See TracChangeset
for help on using the changeset viewer.
