| 1 | #ifndef AMBRES_H
|
|---|
| 2 | #define AMBRES_H
|
|---|
| 3 |
|
|---|
| 4 | #include <iostream>
|
|---|
| 5 | #include <map>
|
|---|
| 6 | #include <newmat.h>
|
|---|
| 7 | #include "pppInclude.h"
|
|---|
| 8 | #include "pppParlist.h"
|
|---|
| 9 |
|
|---|
| 10 | namespace BNC_PPP {
|
|---|
| 11 |
|
|---|
| 12 | class AmbRes {
|
|---|
| 13 | public:
|
|---|
| 14 | AmbRes();
|
|---|
| 15 | ~AmbRes();
|
|---|
| 16 |
|
|---|
| 17 | t_irc run(const bncTime& epoTime,
|
|---|
| 18 | const std::vector<t_pppParam*>& params,
|
|---|
| 19 | SymmetricMatrix& QFinal,
|
|---|
| 20 | ColumnVector& xFinal,
|
|---|
| 21 | double& fixRatio,
|
|---|
| 22 | std::ostream& msg);
|
|---|
| 23 |
|
|---|
| 24 | private:
|
|---|
| 25 | static const double sigCon;
|
|---|
| 26 |
|
|---|
| 27 | class ZdAmb {
|
|---|
| 28 | public:
|
|---|
| 29 | ZdAmb(const t_pppParam* amb) : _amb(amb), _index(-1) {}
|
|---|
| 30 | t_prn prn() const {return _amb->prn();}
|
|---|
| 31 | t_lc LC() const {return _amb->LC();}
|
|---|
| 32 | double valueApr() const {return _amb->x0();}
|
|---|
| 33 | int index() const {return _index;}
|
|---|
| 34 | int indexGlobal() const {return _amb->indexNew();}
|
|---|
| 35 | void setIndex(int index) {_index = index;}
|
|---|
| 36 | bncTime firstObsTime() const {return _amb->firstObsTime();}
|
|---|
| 37 | const t_pppParam* ambGlobal() const {return _amb;}
|
|---|
| 38 | private:
|
|---|
| 39 | const t_pppParam* _amb;
|
|---|
| 40 | int _index;
|
|---|
| 41 | };
|
|---|
| 42 |
|
|---|
| 43 | class SdAmb {
|
|---|
| 44 | public:
|
|---|
| 45 | SdAmb(const ZdAmb& zdAmb1, const ZdAmb& zdAmb2,
|
|---|
| 46 | const ColumnVector& xBie, const SymmetricMatrix& covBie);
|
|---|
| 47 | t_lc _LC;
|
|---|
| 48 | t_prn _prn1;
|
|---|
| 49 | t_prn _prn2;
|
|---|
| 50 | double _aprVal;
|
|---|
| 51 | double _bieValue;
|
|---|
| 52 | double _bieSigma;
|
|---|
| 53 | bool _fixed;
|
|---|
| 54 | bncTime _firstObsTime;
|
|---|
| 55 | const t_pppParam* _ambGlobal[2];
|
|---|
| 56 | };
|
|---|
| 57 |
|
|---|
| 58 | class AmbGroup {
|
|---|
| 59 | public:
|
|---|
| 60 | AmbGroup(char sys, const t_lc& LC) : _system(sys), _LC(LC), _zdAmbRef(0) {};
|
|---|
| 61 | char _system;
|
|---|
| 62 | t_lc _LC;
|
|---|
| 63 | const ZdAmb* _zdAmbRef;
|
|---|
| 64 | std::vector<ZdAmb> _zdAmbs;
|
|---|
| 65 | std::vector<SdAmb> _sdAmbs;
|
|---|
| 66 | };
|
|---|
| 67 |
|
|---|
| 68 | static bool isResolvable(const t_pppParam* amb);
|
|---|
| 69 | static bool isFixable(double xx, double sigma, bool* checked = 0);
|
|---|
| 70 |
|
|---|
| 71 | void reset() {
|
|---|
| 72 | _numZdAmbs = 0;
|
|---|
| 73 | _ambGroups.clear();
|
|---|
| 74 | _QQ.cleanup();
|
|---|
| 75 | _xx.cleanup();
|
|---|
| 76 | }
|
|---|
| 77 |
|
|---|
| 78 | void addToGroup(const t_pppParam* amb);
|
|---|
| 79 | void selectReference(AmbGroup& ambGroup);
|
|---|
| 80 | void printBieResults(const ColumnVector& xBie, const SymmetricMatrix& covBie,
|
|---|
| 81 | std::ostream& msg) const;
|
|---|
| 82 | void setConstraints(SymmetricMatrix& QFinal, ColumnVector& xFinal,
|
|---|
| 83 | const ColumnVector& xBie, const SymmetricMatrix& covBie,
|
|---|
| 84 | double& fixRatio, std::ostream& msg);
|
|---|
| 85 |
|
|---|
| 86 | unsigned _numZdAmbs;
|
|---|
| 87 | std::vector<AmbGroup> _ambGroups;
|
|---|
| 88 | SymmetricMatrix _QQ;
|
|---|
| 89 | ColumnVector _xx;
|
|---|
| 90 |
|
|---|
| 91 | };
|
|---|
| 92 |
|
|---|
| 93 | }
|
|---|
| 94 |
|
|---|
| 95 | #endif
|
|---|