Index: trunk/BNC/bncmodel.cpp
===================================================================
--- trunk/BNC/bncmodel.cpp	(revision 2108)
+++ trunk/BNC/bncmodel.cpp	(revision 2109)
@@ -70,5 +70,4 @@
   prn       = prnIn;
   index_old = 0;
-  x0        = 0.0;
   xx        = 0.0;
 }
@@ -83,11 +82,11 @@
 double bncParam::partial(t_satData* satData, const QString& prnIn) {
   if      (type == CRD_X) {
-    return (x0 - satData->xx(1)) / satData->rho; 
+    return (xx - satData->xx(1)) / satData->rho; 
   }
   else if (type == CRD_Y) {
-    return (x0 - satData->xx(2)) / satData->rho; 
+    return (xx - satData->xx(2)) / satData->rho; 
   }
   else if (type == CRD_Z) {
-    return (x0 - satData->xx(3)) / satData->rho; 
+    return (xx - satData->xx(3)) / satData->rho; 
   }
   else if (type == RECCLK) {
@@ -196,9 +195,9 @@
     t_satData* satData = it2.value();
 
-    ColumnVector dx = satData->xx - _xcBanc.Rows(1,3);
-    double       rho = dx.norm_Frobenius();
+    ColumnVector rr = satData->xx - _xcBanc.Rows(1,3);
+    double       rho = rr.norm_Frobenius();
 
     double neu[3];
-    xyz2neu(_ellBanc.data(), dx.data(), neu);
+    xyz2neu(_ellBanc.data(), rr.data(), neu);
 
     satData->eleSat = acos( sqrt(neu[0]*neu[0] + neu[1]*neu[1]) / rho );
@@ -357,18 +356,13 @@
   if (_static) {
     if (x() == 0.0 && y() == 0.0 && z() == 0.0) {
-      _params[0]->x0 = _xcBanc(1);
-      _params[1]->x0 = _xcBanc(2);
-      _params[2]->x0 = _xcBanc(3);
-    }
-    else {
-      _params[0]->x0 += _params[0]->xx;
-      _params[1]->x0 += _params[1]->xx;
-      _params[2]->x0 += _params[2]->xx;
+      _params[0]->xx = _xcBanc(1);
+      _params[1]->xx = _xcBanc(2);
+      _params[2]->xx = _xcBanc(3);
     }
   }
   else {
-    _params[0]->x0 = _xcBanc(1);
-    _params[1]->x0 = _xcBanc(2);
-    _params[2]->x0 = _xcBanc(3);
+    _params[0]->xx = _xcBanc(1);
+    _params[1]->xx = _xcBanc(2);
+    _params[2]->xx = _xcBanc(3);
 
     _QQ(1,1) += sig_crd_p * sig_crd_p;
@@ -379,5 +373,5 @@
   // Receiver Clocks
   // ---------------
-  _params[3]->x0 = _xcBanc(4);
+  _params[3]->xx = _xcBanc(4);
   for (int iPar = 1; iPar <= _params.size(); iPar++) {
     _QQ(iPar, 4) = 0.0;
@@ -388,20 +382,5 @@
   // ------------------
   if (_estTropo) {
-    _params[4]->x0 += _params[4]->xx;
     _QQ(5,5) += sig_trp_p * sig_trp_p;
-  }
-
-  // Ambiguities
-  // -----------
-  for (int iPar = 1; iPar <= _params.size(); iPar++) {
-    if (_params[iPar-1]->type == bncParam::AMB_L3) {
-      _params[iPar-1]->x0 += _params[iPar-1]->xx;
-    }
-  }
-
-  // Nullify the Solution Vector
-  // ---------------------------
-  for (int iPar = 1; iPar <= _params.size(); iPar++) {
-    _params[iPar-1]->xx = 0.0;
   }
 }
@@ -414,5 +393,5 @@
   const static double MAXRES_PHASE = 0.10;
 
-  ColumnVector    xx;
+  ColumnVector    dx;
 
   bool outlier = false;
@@ -436,20 +415,9 @@
     predict(epoData);
     
-    SymmetricMatrix QQsav = _QQ;
-
+    // Create First-Design Matrix
+    // --------------------------
     unsigned nPar = _params.size();
     unsigned nObs = _usePhase ? 2 * epoData->size() : epoData->size();
     
-    // Set Solution Vector
-    // -------------------
-    xx.ReSize(nPar);
-    QVectorIterator<bncParam*> itPar(_params);
-    while (itPar.hasNext()) {
-      bncParam* par = itPar.next();
-      xx(par->index) = par->xx;
-    }
-    
-    // Create First-Design Matrix
-    // --------------------------
     Matrix          AA(nObs, nPar);  // first design matrix
     ColumnVector    ll(nObs);        // tems observed-computed
@@ -479,5 +447,5 @@
           if (_params[iPar-1]->type == bncParam::AMB_L3 &&
               _params[iPar-1]->prn  == prn) {
-            ll(iObs) -= _params[iPar-1]->x0;
+            ll(iObs) -= _params[iPar-1]->xx;
           } 
           AA(iObs, iPar) = _params[iPar-1]->partial(satData, prn);
@@ -488,25 +456,14 @@
     // Compute Kalman Update
     // ---------------------
-    if (false) {
-      SymmetricMatrix HH; HH << PP + AA * _QQ * AA.t();
-      SymmetricMatrix Hi = HH.i();
-      Matrix          KK  = _QQ * AA.t() * Hi;
-      ColumnVector    v1  = ll - AA * xx;
-                      xx = xx + KK * v1;
-      IdentityMatrix Id(nPar);
-      _QQ << (Id - KK * AA) * _QQ;
-    }
-    else {
-      Matrix ATP = AA.t() * PP;
-      SymmetricMatrix NN = _QQ.i();
-      ColumnVector    bb = NN * xx + ATP * ll;
-      NN << NN + ATP * AA;
-      _QQ = NN.i();
-      xx = _QQ * bb; 
-    }
+    SymmetricMatrix QQsav = _QQ;
+    Matrix ATP = AA.t() * PP;
+    SymmetricMatrix NN = _QQ.i();
+    NN << NN + ATP * AA;
+    _QQ = NN.i();
+    dx = _QQ * ATP * ll; 
     
     // Outlier Detection
     // -----------------
-    ColumnVector vv = ll - AA * xx;
+    ColumnVector vv = ll - AA * dx;
 
     iObs = 0;
@@ -540,10 +497,10 @@
   } while (outlier);
 
-  // Set Solution Vector back
-  // ------------------------
+  // Set Solution Vector
+  // -------------------
   QVectorIterator<bncParam*> itPar(_params);
   while (itPar.hasNext()) {
     bncParam* par = itPar.next();
-    par->xx = xx(par->index);
+    par->xx += dx(par->index);
   }
 
Index: trunk/BNC/bncmodel.h
===================================================================
--- trunk/BNC/bncmodel.h	(revision 2108)
+++ trunk/BNC/bncmodel.h	(revision 2109)
@@ -43,9 +43,7 @@
     return (type == CRD_X || type == CRD_Y || type == CRD_Z);
   }
-  double solVal() const {return x0 + xx;}
-  double aprVal() const {return x0;}
+  double solVal() const {return xx;}
   parType  type;
   double   xx;
-  double   x0;
   int      index;
   int      index_old;
