Changeset 9419 in ntrip for trunk/BNC/src/PPP/pppFilter.h


Ignore:
Timestamp:
May 3, 2021, 2:18:39 PM (3 years ago)
Author:
stuerze
Message:

update regarding PPP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppFilter.h

    r9386 r9419  
    2424
    2525  t_irc datumTransformation();
    26   void initDatumTransformation(const std::vector<t_pppSatObs*>& allObs);
     26  void initDatumTransformation(const std::vector<t_pppSatObs*>& allObs, bool pseudoObsIono);
     27  unsigned setTrafoObs();
    2728
    2829  const ColumnVector&    x() const {return _xFlt;}
     
    7980  class t_datumTrafo {
    8081  public:
    81     t_datumTrafo () {initIndices();}
    82     void initIndices() {_firstRow = 1; _lastRow = 0;}
    83     void setFirstSystem(bool firstSys) {_firstSys = firstSys;}
    84     bool firstSystem() {return _firstSys;}
    85     void updateIndices(int maxObsSys) {
    86       if (firstSystem()) {
     82    t_datumTrafo () {
     83      initIndices();
     84    }
     85    ~t_datumTrafo () {
     86
     87    }
     88
     89    void initIndices() {
     90      _firstRow = 1; _lastRow = 0;
     91    }
     92
     93    void setFirstSystem(char firstSys) {
     94      _firstSys = firstSys;
     95    }
     96
     97    bool firstSystem(char sys) {
     98      if (_firstSys == sys) {
     99        return true;
     100      }
     101      return false;
     102    }
     103
     104    void updateIndices(char sys, int maxObsSys) {
     105      if (firstSystem(sys)) {
    87106        initIndices();
    88107      }
     
    90109        _firstRow = _lastRow + 1;
    91110      }
    92       _lastRow += maxObsSys;
    93 
     111      _lastRow += maxObsSys;//LOG << "updateIndices: lastRow: " << _lastRow << endl;
    94112    };
    95     void setObsNum(int maxObs) {_maxObs = maxObs;}
    96     void setParNum(int numPar) {_numPar = numPar;}
    97     int obsNum() {return _maxObs;}
    98     int parNum() {return _numPar;}
     113
     114    void setNumObs(int maxObs) {_maxObs = maxObs;}
     115    void setNumPar(int numPar) { _numPar = numPar;}
     116    void setLastEpoParlist(t_pppParlist* parlist) {_parlist = parlist;}
     117    t_pppParlist* lastEpoParlist() {return _parlist;}
     118    int numPar() {return _numPar;}
     119    int numObs() {return _maxObs;}
     120    void updateNumObs() {//LOG << "updateObsNum _maxObs " << _maxObs;
     121      _maxObs = _lastRow;//LOG << "=>  _maxObs " << _maxObs << " _numPar: " << _numPar << endl;
     122      _AA1 = _AA1.SubMatrix(1, _lastRow, 1, _numPar);
     123      _AA2 = _AA2.SubMatrix(1, _lastRow, 1, _numPar);
     124    }
     125
    99126    const Matrix& AA1() {return _AA1;}
    100127    const Matrix& AA2() {return _AA2;}
    101 
    102     void initAA() {
     128    const Matrix& D21() {return _D21;}
     129
     130    void initAA() {//LOG << "initAA: _maxObs: " << _maxObs << " _numPar: " << _numPar << endl;
    103131      _AA1.ReSize(_maxObs, _numPar); _AA1 = 0.0;
    104132      _AA2.ReSize(_maxObs, _numPar); _AA2 = 0.0;
     133      _D21.ReSize(_numPar, _numPar); _D21 = 0.0;
    105134    }
    106135
     
    112141      Prep->SubMatrix(_firstRow, _lastRow, 1, _numPar) << AA;
    113142    }
     143
    114144    void switchAA() {
    115145      _AA1 = _AA2;
    116146    }
    117     Matrix&  getAA(int ind) {
    118       if (ind == 1) {
    119           return _AA1;
    120       }
    121       return _AA2;
    122     }
    123     Matrix computeTrafoMatrix() {
    124       Matrix D21 = ((_AA2.t() * _AA2).i()) * _AA2.t() * _AA1;
    125       return D21;
    126     }
     147
     148    t_irc computeTrafoMatrix() {
     149      if (((_AA2.t() * _AA2)).Determinant() == 0.0) {
     150        LOG << "(_AA2.t() * _AA2).inv() is singular" << endl;
     151        return failure;
     152      }
     153      _D21 = ((_AA2.t() * _AA2).i()) * _AA2.t() * _AA1;
     154      return success;
     155    }
     156
    127157    void printMatrix(const Matrix& X, int nRow, int nCol) {
    128158      for (int rr = 0; rr < nRow; rr++) {
     
    134164      LOG << endl;
    135165    }
    136 
     166  private:
    137167    int               _firstRow;
    138168    int               _lastRow;
    139169    Matrix            _AA1;
    140170    Matrix            _AA2;
    141     bool              _firstSys;
     171    Matrix            _D21;
     172    char              _firstSys;
    142173    int               _maxObs;
    143174    int               _numPar;
    144175    QMap<char, t_prn> _refSatMapPseudoObs;
     176    t_pppParlist*     _parlist;
    145177  };
    146178
Note: See TracChangeset for help on using the changeset viewer.