Index: /trunk/BNC/src/PPP/pppFilter.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppFilter.cpp	(revision 5915)
+++ /trunk/BNC/src/PPP/pppFilter.cpp	(revision 5916)
@@ -84,36 +84,13 @@
     return failure;
   }
-  vector<t_pppSatObs*>& obsVector = epoch->obsVector();
+  vector<t_pppSatObs*>& allObs = epoch->obsVector();
 
   // Time of the Epoch
   // -----------------
   _epoTime = epoch->epoTime();
-
-  // Auxiliary vectors of processed linear combinations
-  // --------------------------------------------------
-  vector<t_lc::type> LCsCode;
-  vector<t_lc::type> LCsPhase;
-  vector<t_lc::type> LCsAll = OPT->LCs();
-  for (unsigned ii = 0; ii < LCsAll.size(); ii++) {
-    const t_lc::type& tLC = LCsAll[ii];
-    if (t_lc::includesCode(tLC) && !t_lc::includesPhase(tLC)) {
-      LCsCode.push_back(tLC);
-    }
-    else {
-      LCsPhase.push_back(tLC);
-    }
-  }
-  vector<t_lc::type> ambLCs;
-  if      (LCsPhase.size() == 1) {
-    ambLCs.push_back(LCsPhase[0]);
-  }
-  else if (LCsPhase.size() > 1) {
-    ambLCs.push_back(t_lc::l1);
-    ambLCs.push_back(t_lc::l2);
-  }
   
   // Set Parameters
   // --------------
-  _parlist->set(_epoTime, ambLCs, obsVector);
+  _parlist->set(_epoTime, allObs);
   const vector<t_pppParam*>& params = _parlist->params();
 
@@ -149,14 +126,20 @@
   }
 
-  // Process LCs containing code separately
-  // --------------------------------------
-  for (unsigned ipc = 0; ipc <= 1; ipc++) { 
-    const vector<t_lc::type>& LCsHlp = (ipc == 0 ? LCsCode : LCsPhase);
-    if (LCsHlp.size() > 0) {
-      if ( processLC(LCsHlp, obsVector) != success ) {
-        return failure;
-      }
-    }
-  }
+  // Process Satellite Systems separately
+  // ------------------------------------
+  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
+    char system = OPT->systems()[iSys];
+    vector<t_pppSatObs*> obsVector;
+    for (unsigned jj = 0; jj < allObs.size(); jj++) {
+      if (allObs[jj]->prn().system() == system) {
+        obsVector.push_back(allObs[jj]);
+      }
+    }
+    if ( processSystem(OPT->LCs(system), obsVector) != success ) {
+      return failure;
+    }
+  }
+   
+  cmpDOP(allObs);
 
   _parlist->printResult(_epoTime, _QFlt, _xFlt);
@@ -167,6 +150,6 @@
 // Process Selected LCs
 ////////////////////////////////////////////////////////////////////////////
-t_irc t_pppFilter::processLC(const vector<t_lc::type>& LCs, 
-                               vector<t_pppSatObs*>& obsVector) {
+t_irc t_pppFilter::processSystem(const vector<t_lc::type>& LCs, 
+                                 const vector<t_pppSatObs*>& obsVector) {
 
   LOG.setf(ios::fixed);
@@ -257,21 +240,14 @@
     double     maxOutlier      = 0.0;
     int        maxOutlierIndex = -1;
-    t_lc::type maxOutlierLC = t_lc::dummy;
-    for (unsigned sysGPS = 0; sysGPS <= 1; sysGPS++) { // first GLONASS then GPS
-      for (unsigned ii = 0; ii < usedObs.size(); ii++) {
-        if (usedObs[ii]->prn().system() != 'G' || sysGPS == 1) {
-          const t_lc::type tLC = usedTypes[ii];
-          double res = fabs(vv[ii]);
-          if (res > OPT->maxRes(tLC)) {
-            if (res > fabs(maxOutlier)) {
-              maxOutlier      = vv[ii];
-              maxOutlierIndex = ii;
-              maxOutlierLC    = tLC;
-            }
-          }
-        }
-      }
-      if (maxOutlierIndex != -1) {
-        break;
+    t_lc::type maxOutlierLC    = t_lc::dummy;
+    for (unsigned ii = 0; ii < usedObs.size(); ii++) {
+      const t_lc::type tLC = usedTypes[ii];
+      double res = fabs(vv[ii]);
+      if (res > usedObs[ii]->maxRes(tLC)) {
+        if (res > fabs(maxOutlier)) {
+          maxOutlier      = vv[ii];
+          maxOutlierIndex = ii;
+          maxOutlierLC    = tLC;
+        }
       }
     }
@@ -322,5 +298,4 @@
         }
       }
-      cmpDOP(LCs, AA);
       break;
     }
@@ -333,5 +308,5 @@
 ////////////////////////////////////////////////////////////////////////////
 t_irc t_pppFilter::detectCycleSlips(const vector<t_lc::type>& LCs, 
-                                      const vector<t_pppSatObs*>& obsVector) {
+                                    const vector<t_pppSatObs*>& obsVector) {
 
   const double            SLIP       = 20.0;  // slip threshold
@@ -402,5 +377,5 @@
 ////////////////////////////////////////////////////////////////////////////
 t_irc t_pppFilter::resetAmb(t_prn prn, const vector<t_pppSatObs*>& obsVector,
-                         SymmetricMatrix* QSav, ColumnVector* xSav) {
+                            SymmetricMatrix* QSav, ColumnVector* xSav) {
   t_irc irc = failure;
   vector<t_pppParam*>& params = _parlist->params();
@@ -438,22 +413,27 @@
 // Compute various DOP Values
 ////////////////////////////////////////////////////////////////////////////
-void t_pppFilter::cmpDOP(const std::vector<t_lc::type>& LCs, const Matrix& AA) {
+void t_pppFilter::cmpDOP(const vector<t_pppSatObs*>& obsVector) {
 
   _dop.reset();
-  _numSat = 0;
+
   try {
-    _numSat = AA.Nrows() / LCs.size();
-    
+    const unsigned numPar = 4;
+    Matrix AA(obsVector.size(), numPar);
+    _numSat = 0;
+    for (unsigned ii = 0; ii < obsVector.size(); ii++) {
+      t_pppSatObs* obs = obsVector[ii];
+      if (obs->isValid() && !obs->outlier()) {
+        ++_numSat;
+        for (unsigned iPar = 0; iPar < numPar; iPar++) {
+          const t_pppParam* par = _parlist->params()[iPar];
+          AA[_numSat-1][iPar] = par->partial(_epoTime, obs, t_lc::c1);
+        }
+      }
+    }
     if (_numSat < 4) {
       return;
     }
-    
-    Matrix BB(_numSat, 4);
-    
-    for (int ii = 1; ii <= _numSat; ii++) {
-      BB.Row(ii) = AA.Row(ii*LCs.size()).columns(1,4);
-    }
-    
-    SymmetricMatrix NN; NN << BB.t() * BB;  
+    AA = AA.Rows(1, _numSat);
+    SymmetricMatrix NN; NN << AA.t() * AA;  
     SymmetricMatrix QQ = NN.i();
     
Index: /trunk/BNC/src/PPP/pppFilter.h
===================================================================
--- /trunk/BNC/src/PPP/pppFilter.h	(revision 5915)
+++ /trunk/BNC/src/PPP/pppFilter.h	(revision 5916)
@@ -50,5 +50,6 @@
     double G;
   };
-  t_irc processLC(const std::vector<t_lc::type>& LCs, std::vector<t_pppSatObs*>& obsVector);
+  t_irc processSystem(const std::vector<t_lc::type>& LCs, 
+                      const std::vector<t_pppSatObs*>& obsVector);
 
   t_irc detectCycleSlips(const std::vector<t_lc::type>& LCs, 
@@ -58,5 +59,5 @@
                  SymmetricMatrix* QSav = 0, ColumnVector* xSav = 0);
 
-  void cmpDOP(const std::vector<t_lc::type>& LCs, const Matrix& AA);
+  void cmpDOP(const std::vector<t_pppSatObs*>& obsVector);
 
   bncTime         _epoTime;
Index: /trunk/BNC/src/PPP/pppParlist.h
===================================================================
--- /trunk/BNC/src/PPP/pppParlist.h	(revision 5915)
+++ /trunk/BNC/src/PPP/pppParlist.h	(revision 5916)
@@ -97,7 +97,5 @@
   ~t_pppParlist();
 
-  t_irc set(const bncTime& epoTime, const std::vector<t_lc::type>& ambLCs,
-            const std::vector<t_pppSatObs*>& obsVector);
-
+  t_irc set(const bncTime& epoTime, const std::vector<t_pppSatObs*>& obsVector);
   unsigned nPar() const {return _params.size();}
   const std::vector<t_pppParam*>& params() const {return _params;}
Index: /trunk/BNC/src/PPP/pppSatObs.h
===================================================================
--- /trunk/BNC/src/PPP/pppSatObs.h	(revision 5915)
+++ /trunk/BNC/src/PPP/pppSatObs.h	(revision 5916)
@@ -34,4 +34,5 @@
   double              lambda(t_lc::type tLC) const;
   double              sigma(t_lc::type tLC) const;
+  double              maxRes(t_lc::type tLC) const;
   bool                outlier() const {return _outlier;}
   void                setOutlier() {_outlier = true;}
