Index: trunk/BNC/src/PPP/pppFilter.cpp
===================================================================
--- trunk/BNC/src/PPP/pppFilter.cpp	(revision 9498)
+++ trunk/BNC/src/PPP/pppFilter.cpp	(revision 9504)
@@ -34,5 +34,4 @@
 ////////////////////////////////////////////////////////////////////////////
 t_pppFilter::t_pppFilter(t_pppObsPool* obsPool) {
-  _parlist = 0;
   _numSat = 0;
   _obsPool = obsPool;
@@ -44,5 +43,4 @@
 ////////////////////////////////////////////////////////////////////////////
 t_pppFilter::~t_pppFilter() {
-  delete _parlist;
   delete _datumTrafo;
 }
@@ -53,8 +51,4 @@
   _numSat     = 0;
   const double maxSolGap = 60.0;
-
-  if (!_parlist) {
-    _parlist = new t_pppParlist();
-  }
 
   // Vector of all Observations
@@ -78,14 +72,20 @@
   string epoTimeStr = string(_epoTime);
 
+  if (OPT->_obsModelType == OPT->DCMcodeBias ||
+      OPT->_obsModelType == OPT->DCMphaseBias) {
+     // Save parameters of epoch before
+    _parlist_sav = _parlist;
+ }
+
   //--
   // Set Parameters
-  // --------------
-  if (_parlist->set(_epoTime, allObs, _obsPool->getRefSatMap()) != success) {
+  if (_parlist.set(_epoTime, allObs, _obsPool->getRefSatMap()) != success) {
     return failure;
   }
-  const vector<t_pppParam*>& params = _parlist->params();
+
+  const vector<t_pppParam*>& params = _parlist.params();
 #ifdef BNC_DEBUG_PPP
-  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
-    LOG << params[iPar]->toString() << endl;
+  for (int iPar = 0; iPar < params.size(); iPar++) {
+    LOG << "available par " << params[iPar]->toString() << endl;
   }
 #endif
@@ -96,7 +96,7 @@
   SymmetricMatrix QFltOld = _QFlt;
 
-  _QFlt.ReSize(_parlist->nPar()); _QFlt = 0.0;
-  _xFlt.ReSize(_parlist->nPar()); _xFlt = 0.0;
-  _x0.ReSize(_parlist->nPar());   _x0   = 0.0;
+  _QFlt.ReSize(_parlist.nPar()); _QFlt = 0.0;
+  _xFlt.ReSize(_parlist.nPar()); _xFlt = 0.0;
+  _x0.ReSize(_parlist.nPar());   _x0   = 0.0;
 
   for (unsigned ii = 0; ii < params.size(); ii++) {
@@ -130,5 +130,5 @@
       OPT->_obsModelType == OPT->DCMphaseBias) {
     preProcessing = true;
-    QList<char>& usedSystems = _parlist->usedSystems();
+    const QList<char>& usedSystems = _parlist.usedSystems();
     for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
       char sys = usedSystems[iSys];
@@ -155,4 +155,5 @@
       _xFlt = xFltOld;
       _QFlt = QFltOld;
+      _parlist = _parlist_sav;
       return success;
     }
@@ -165,5 +166,5 @@
   // ------------------------------------
   preProcessing = false;
-  QList<char>& usedSystems = _parlist-> usedSystems();
+  const QList<char>& usedSystems = _parlist. usedSystems();
   for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     char sys = usedSystems[iSys];
@@ -195,9 +196,8 @@
   // ----------------------
   cmpDOP(allObs);
-  _parlist->printResult(_epoTime, _QFlt, _xFlt);
+  _parlist.printResult(_epoTime, _QFlt, _xFlt);
   _lastEpoTimeOK = _epoTime;  // remember time of last successful epoch processing
   if (OPT->_refSatRequired) {
     _obsPool->saveLastEpoRefSats();
-    _datumTrafo->setLastEpoParlist(_parlist);
   }
   return success;
@@ -226,5 +226,5 @@
   SymmetricMatrix            QSav       = _QFlt;
   string                     epoTimeStr = string(_epoTime);
-  const vector<t_pppParam*>& params     = _parlist->params();
+  const vector<t_pppParam*>& params     = _parlist.params();
 
   unsigned usedLCs     = LCs.size();
@@ -256,5 +256,5 @@
     // First-Design Matrix, Terms Observed-Computed, Weight Matrix
     // -----------------------------------------------------------
-    Matrix                AA(maxObs, _parlist->nPar());
+    Matrix                AA(maxObs, _parlist.nPar());
     ColumnVector          ll(maxObs);
     DiagonalMatrix        PP(maxObs); PP = 0.0;
@@ -318,5 +318,5 @@
         (!preProcessing)) {
       _datumTrafo->updateIndices(sys, iObs+1);
-      _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist->nPar()), 1);
+      _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist.nPar()), 1);
     }
 
@@ -460,5 +460,5 @@
   char sys = refPrn.system();
   string epoTimeStr = string(_epoTime);
-  const vector<t_pppParam*>& params  = _parlist->params();
+  const vector<t_pppParam*>& params  = _parlist.params();
 
   for (unsigned ii = 0; ii < LCs.size(); ii++) {
@@ -542,5 +542,5 @@
 
   t_irc irc = failure;
-  vector<t_pppParam*>& params = _parlist->params();
+  vector<t_pppParam*>& params = _parlist.params();
   for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     t_pppParam* par = params[iPar];
@@ -579,5 +579,5 @@
 
   t_irc irc = failure;
-  vector<t_pppParam*>& params = _parlist->params();
+  vector<t_pppParam*>& params = _parlist.params();
   for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     t_pppParam* par = params[iPar];
@@ -614,5 +614,5 @@
         ++_numSat;
         for (unsigned iPar = 0; iPar < numPar; iPar++) {
-          const t_pppParam* par = _parlist->params()[iPar];
+          const t_pppParam* par = _parlist.params()[iPar];
           AA[_numSat-1][iPar] = par->partial(_epoTime, obs, t_lc::c1, refPrn);
         }
@@ -640,5 +640,5 @@
 void t_pppFilter::predictCovCrdPart(const SymmetricMatrix& QFltOld) {
 
-  const vector<t_pppParam*>& params = _parlist->params();
+  const vector<t_pppParam*>& params = _parlist.params();
   if (params.size() < 3) {
     return;
@@ -705,17 +705,16 @@
   // set AA2
   // =======
-  t_pppParlist* parlist = _datumTrafo->lastEpoParlist();
-  if (parlist->set(epoch->epoTime(), allObs, _obsPool->getRefSatMap()) != success) {
+  if (_parlist.set(epoch->epoTime(), allObs, _obsPool->getRefSatMap()) != success) {
     return failure;
   }
-  vector<t_pppParam*>& params = parlist->params();
-  unsigned nPar = parlist->nPar();
+  const vector<t_pppParam*>& _params = _parlist.params();
+  unsigned nPar = _parlist.nPar();
 #ifdef BNC_DEBUG_PPP
   LOG << " parameters of last epoch" << endl;
   for (unsigned iPar = 0; iPar < nPar; iPar++) {
-    LOG << params[iPar]->toString() << "\t\t" << endl;
+    LOG << _params[iPar]->toString() << "\t\t" << endl;
   }
 #endif
-  QList<char>& usedSystems = _parlist->usedSystems();
+  const QList<char>& usedSystems = _parlist.usedSystems();
   for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     char sys = usedSystems[iSys];
@@ -760,6 +759,6 @@
         if (tLC == t_lc::Tz0) {continue;}
         ++iObs;
-        for (unsigned iPar = 0; iPar < params.size(); iPar++) {
-          const t_pppParam* par = params[iPar];
+        for (unsigned iPar = 0; iPar < _params.size(); iPar++) {
+          const t_pppParam* par = _params[iPar];
           AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
         }
@@ -778,6 +777,6 @@
           ++iObs;
           pseudoObsTropoConsidered = true;
-          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
-            const t_pppParam* par = params[iPar];
+          for (unsigned iPar = 0; iPar < _params.size(); iPar++) {
+            const t_pppParam* par = _params[iPar];
             AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
           }
@@ -836,7 +835,4 @@
   _datumTrafo->switchAA();
 
-  // save parameter list
-  // ====================
-  _datumTrafo->setLastEpoParlist(_parlist);
   return success;
 }
@@ -847,5 +843,5 @@
                                           bool pseudoObsIono) {
   unsigned trafoObs = 0;
-  QList<char>& usedSystems = _parlist-> usedSystems();
+  const QList<char>& usedSystems = _parlist. usedSystems();
   for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     char sys = usedSystems[iSys];
@@ -875,5 +871,5 @@
   }
   _datumTrafo->setNumObs(trafoObs);
-  _datumTrafo->setNumPar(_parlist->nPar());
+  _datumTrafo->setNumPar(_parlist.nPar());
   _datumTrafo->initAA();
 }
@@ -884,5 +880,5 @@
   bool resetRefSat;
   // reference satellite definition per system
-  QList<char>& usedSystems = _parlist-> usedSystems();
+  const QList<char>& usedSystems = _parlist.usedSystems();
   for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     resetRefSat = false;
Index: trunk/BNC/src/PPP/pppFilter.h
===================================================================
--- trunk/BNC/src/PPP/pppFilter.h	(revision 9498)
+++ trunk/BNC/src/PPP/pppFilter.h	(revision 9504)
@@ -36,5 +36,5 @@
   double GDOP() const {return _dop.G;}
   double trp() const {
-    const std::vector<t_pppParam*>& par = _parlist->params();
+    const std::vector<t_pppParam*>& par = _parlist.params();
     for (unsigned ii = 0; ii < par.size(); ++ii) {
       if (par[ii]->type() == t_pppParam::trp) {
@@ -45,5 +45,5 @@
   };
   double trpStdev() const {
-    const std::vector<t_pppParam*>& par = _parlist->params();
+    const std::vector<t_pppParam*>& par = _parlist.params();
     for (unsigned ii = 0; ii < par.size(); ++ii) {
       if (par[ii]->type() == t_pppParam::trp) {
@@ -91,5 +91,5 @@
         _firstRow = _lastRow + 1;
       }
-      _lastRow += maxObsSys;//LOG << "updateIndices: lastRow: " << _lastRow << endl;
+      _lastRow += maxObsSys;//LOG << sys << " updateIndices: lastRow: " << _lastRow << "\n" ;
     };
 
@@ -110,7 +110,4 @@
       _AA2 = _AA2.SubMatrix(1, _lastRow, 1, _numPar);
     }
-
-    void setLastEpoParlist(t_pppParlist* parlist) {_parlist = parlist;}
-    t_pppParlist* lastEpoParlist() {return _parlist;}
 
     const Matrix& AA1() {return _AA1;}
@@ -161,5 +158,4 @@
     int               _numPar;
     QMap<char, t_prn> _refSatMapPseudoObs;
-    t_pppParlist*     _parlist;
   };
 
@@ -187,5 +183,6 @@
 
   bncTime         _epoTime;
-  t_pppParlist*   _parlist;
+  t_pppParlist    _parlist;
+  t_pppParlist    _parlist_sav;
   t_pppObsPool*   _obsPool;
   t_datumTrafo*   _datumTrafo;
Index: trunk/BNC/src/PPP/pppParlist.cpp
===================================================================
--- trunk/BNC/src/PPP/pppParlist.cpp	(revision 9498)
+++ trunk/BNC/src/PPP/pppParlist.cpp	(revision 9504)
@@ -35,5 +35,5 @@
 ////////////////////////////////////////////////////////////////////////////
 t_pppParam::t_pppParam(e_type type, const t_prn& prn, t_lc::type tLC,
-                 const vector<t_pppSatObs*>* obsVector) {
+                       const vector<t_pppSatObs*>* obsVector) {
 
   _type     = type;
@@ -132,10 +132,34 @@
 }
 
+//
+////////////////////////////////////////////////////////////////////////////
+t_pppParam::t_pppParam(const t_pppParam* old) {
+  _type     = old->type();
+  _prn      = old->prn();
+  _tLC      = old->tLC();
+  _indexOld = old->indexOld();
+  _indexNew = old->indexNew();
+  _noise    = old->noise();
+  _sigma0   = old->sigma0();
+  _epoSpec  = old->epoSpec();
+  _ambInfo  = 0;
+  if (_type == t_pppParam::amb) {
+    _ambInfo  = new t_ambInfo();
+    _ambInfo->_resetCandidate = old->_ambInfo->_resetCandidate;
+    _ambInfo->_eleSat         = old->_ambInfo->_eleSat;
+    _ambInfo->_numEpo         = old->_ambInfo->_numEpo;
+    _x0 = x0();
+  } else {
+    cout << endl;
+  }
+}
+
 // Destructor
 ////////////////////////////////////////////////////////////////////////////
 t_pppParam::~t_pppParam() {
-  delete _ambInfo;
-}
-
+  if (_ambInfo) {
+    delete _ambInfo;
+  }
+}
 //
 ////////////////////////////////////////////////////////////////////////////
@@ -353,7 +377,47 @@
 ////////////////////////////////////////////////////////////////////////////
 t_pppParlist::~t_pppParlist() {
-  for (unsigned ii = 0; ii < _params.size(); ii++) {
-    delete _params[ii];
-  }
+  _usedSystems.clear();
+
+  vector<t_pppParam*>::iterator it = _params.begin();
+  while (it != _params.end()) {
+    t_pppParam* par = *it;
+    delete par;
+    it = _params.erase(it);
+  }
+}
+
+//
+////////////////////////////////////////////////////////////////////////////
+t_pppParlist::t_pppParlist(const t_pppParlist& old) {
+
+  _usedSystems = old._usedSystems;
+
+  vector<t_pppParam*>::const_iterator it = old.params().begin();
+  while (it != old.params().end()) {
+    const t_pppParam* oldParam = *it;
+    _params.push_back(new t_pppParam(oldParam));
+  }
+}
+
+//
+////////////////////////////////////////////////////////////////////////////
+const t_pppParlist& t_pppParlist::operator= (const t_pppParlist& p) {
+
+  _usedSystems.clear();
+
+  _usedSystems = p._usedSystems;
+
+  vector<t_pppParam*>::iterator it = _params.begin();
+  while (it != _params.end()) {
+    t_pppParam* par = *it;
+    delete par;
+    it = _params.erase(it);
+  }
+
+  for (unsigned jj = 0; jj < p.params().size(); jj++) {
+    t_pppParam* parFrom = p.params()[jj];
+    _params.push_back(new t_pppParam(parFrom));
+  }
+  return *this;
 }
 
@@ -685,6 +749,7 @@
   t_pppParam* parY = 0;
   t_pppParam* parZ = 0;
-  for (unsigned ii = 0; ii < _params.size(); ii++) {
-    t_pppParam* par = _params[ii];
+  vector<t_pppParam*>::const_iterator it = _params.begin();
+  while (it != _params.end()) {
+    t_pppParam* par = *it;
     if      (par->type() == t_pppParam::crdX) {
       parX = par;
@@ -710,4 +775,5 @@
       LOG << endl;
     }
+    ++it;
   }
 
Index: trunk/BNC/src/PPP/pppParlist.h
===================================================================
--- trunk/BNC/src/PPP/pppParlist.h	(revision 9498)
+++ trunk/BNC/src/PPP/pppParlist.h	(revision 9504)
@@ -20,5 +20,5 @@
 
   t_pppParam(e_type type, const t_prn& prn, t_lc::type tLC, const std::vector<t_pppSatObs*>* obsVector = 0);
-
+  t_pppParam(const t_pppParam* old);
   ~t_pppParam();
 
@@ -71,5 +71,5 @@
     return false;
   }
-
+  
  private:
   class t_ambInfo {
@@ -103,5 +103,6 @@
   t_pppParlist();
   ~t_pppParlist();
-
+  t_pppParlist(const t_pppParlist& old);
+  const t_pppParlist&operator= (const t_pppParlist& p);
   t_irc set(const bncTime& epoTime, const std::vector<t_pppSatObs*>& obsVector,
             const QMap<char, t_pppRefSat*>& refSatMap);
@@ -109,5 +110,5 @@
   const std::vector<t_pppParam*>& params() const {return _params;}
         std::vector<t_pppParam*>& params()       {return _params;}
-  QList<char>& usedSystems() {return _usedSystems;}
+  const QList<char>& usedSystems() const {return _usedSystems;}
   void printResult(const bncTime& epoTime, const SymmetricMatrix& QQ,
                    const ColumnVector& xx) const;
