Changeset 3134 in ntrip for trunk/BNC/combination/bnccomb.cpp


Ignore:
Timestamp:
Mar 25, 2011, 12:51:09 PM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/combination/bnccomb.cpp

    r3081 r3134  
    3131using namespace std;
    3232
     33const int MAXPRN_GPS = 32;
     34
    3335// Constructor
    3436////////////////////////////////////////////////////////////////////////////
     
    137139    it.next();
    138140    cmbAC* AC = it.value();
    139     if (AC->name != _masterAC) {
    140       _params.push_back(new cmbParam(cmbParam::AC_offset, ++nextPar,
    141                                      AC->name, "", sigAC_0, sigAC_P));
    142       for (int iGps = 1; iGps <= 32; iGps++) {
    143         QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    144         _params.push_back(new cmbParam(cmbParam::Sat_offset, ++nextPar,
    145                                        AC->name, prn, sigSat_0, sigSat_P));
    146       }
    147     }
    148   }
    149   for (int iGps = 1; iGps <= 32; iGps++) {
     141    _params.push_back(new cmbParam(cmbParam::AC_offset, ++nextPar,
     142                                   AC->name, "", sigAC_0, sigAC_P));
     143    for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
     144      QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
     145      _params.push_back(new cmbParam(cmbParam::Sat_offset, ++nextPar,
     146                                     AC->name, prn, sigSat_0, sigSat_P));
     147    }
     148  }
     149  for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
    150150    QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    151151    _params.push_back(new cmbParam(cmbParam::clk, ++nextPar, "", prn,
     
    598598
    599599  if (nObs > 0) {
    600     Matrix         AA(nObs, nPar);
    601     ColumnVector   ll(nObs);
    602     DiagonalMatrix PP(nObs); PP = 1.0;
     600    const int nCon = 2 + MAXPRN_GPS;
     601    Matrix         AA(nObs+nCon, nPar);  AA = 0.0;
     602    ColumnVector   ll(nObs+nCon);        ll = 0.0;
     603    DiagonalMatrix PP(nObs+nCon);        PP = 1.0;
    603604
    604605    int iObs = 0;
     
    628629    }
    629630
     631    // Regularization
     632    // --------------
     633    const double Ph = 1.e6;
     634    int iCond = 1;
     635    PP(nObs+iCond) = Ph;
     636    for (int iPar = 1; iPar <= _params.size(); iPar++) {
     637      cmbParam* pp = _params[iPar-1];
     638      if      (pp->type == cmbParam::AC_offset) {
     639        AA(nObs+iCond, iPar) = 1.0;
     640      }
     641    }
     642
     643    ++iCond;
     644    PP(nObs+iCond) = Ph;
     645    for (int iPar = 1; iPar <= _params.size(); iPar++) {
     646      cmbParam* pp = _params[iPar-1];
     647      if      (pp->type == cmbParam::clk) {
     648        AA(nObs+iCond, iPar) = 1.0;
     649      }
     650    }
     651
     652    for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
     653      ++iCond;
     654      QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
     655      PP(nObs+1+iGps) = Ph;
     656      for (int iPar = 1; iPar <= _params.size(); iPar++) {
     657        cmbParam* pp = _params[iPar-1];
     658        if (pp->type == cmbParam::Sat_offset && pp->prn == prn) {
     659          AA(nObs+iCond, iPar) = 1.0;
     660        }
     661      }
     662    }
     663
    630664    const double MAXRES = 999.10;  // TODO: make it an option
    631665
Note: See TracChangeset for help on using the changeset viewer.