103 double **ppRx=a->
ppRx_;
104 double **ppAx=a->
ppAx_;
110 pthread_mutex_t *pthMutL = a->
pthMutL_;
113 double ul=0.0, s=0.0, g=0.0;
119 pthread_mutex_lock(pthMutL);
120 l = *lastPrcColumn + 1;
133 pthread_mutex_lock(pthMutexes + l);
136 s = *(*(ppRx+l)+l)**(*(ppRx+l)+l);
138 for (i=0; i<nZ; i++, p++)
143 s = -
signum(*(*(ppRx+l)+l))*sqrt(s);
145 ul = *(*(ppRx+l)+l) - s;
146 memcpy((
void*)(pU), (
void*)(*(ppAx+l)),
sizeof(
double)*(nZ));
152 pthread_mutex_lock (pthMutexes + l + 1);
155 pthread_mutex_unlock(pthMutL);
157 pthread_mutex_unlock(pthMutexes + l);
159 for (j=l+1; j<num; j++)
161 g = ul**(*(ppRx+j)+l);
164 for (i=0; i<nZ; i++, p++, q++)
167 *(*(ppRx+j)+l) += s*g*ul;
170 for (i=0; i<nZ; i++, p++, q++)
172 pthread_mutex_lock (pthMutexes + j + 1);
173 pthread_mutex_unlock(pthMutexes + j);
179 for (i=0; i<nZ; i++, p++, q++)
185 for (i=0; i<nZ; i++, p++, q++)
188 pthread_mutex_unlock(pthMutexes + num);
193 pthread_mutex_unlock(pthMutL);
194 pthread_mutex_unlock(pthMutexes + l);
212 double **ppRp = a->
ppRp_;
213 double **ppRpx = a->
ppRpx_;
214 double **ppAp = a->
ppAp_;
215 double **ppAx = a->
ppAx_;
216 double *pZp = a->
pZp_;
221 pthread_mutex_t *pthMutL = a->
pthMutL_;
224 double ul=0.0, s=0.0, g=0.0;
230 pthread_mutex_lock(pthMutL);
231 l = *lastPrcColumn + 1;
235 pthread_mutex_lock(pthMutexes + l);
239 s = *(*(ppRp+l)+l)**(*(ppRp+l)+l);
241 for (i=0; i<nZ; i++, p++)
246 s = -
signum(*(*(ppRp+l)+l))*sqrt(s);
248 ul = *(*(ppRp+l)+l) - s;
249 memcpy((
void*)(pU), (
void*)(*(ppAp+l)),
sizeof(
double)*(nZ));
255 pthread_mutex_lock (pthMutexes + l + 1);
259 pthread_mutex_unlock(pthMutL);
262 pthread_mutex_unlock(pthMutexes + l);
265 for (j=l+1; j<nP; j++)
267 g = ul**(*(ppRp+j)+l);
270 for (i=0; i<nZ; i++, p++, q++)
273 *(*(ppRp+j)+l) += s*g*ul;
276 for (i=0; i<nZ; i++, p++, q++)
278 pthread_mutex_lock (pthMutexes + j + 1);
280 pthread_mutex_unlock(pthMutexes + j);
286 g = ul**(*(ppRpx+j)+l);
289 for (i=0; i<nZ; i++, p++, q++)
292 *(*(ppRpx+j)+l) += s*g*ul;
295 for (i=0; i<nZ; i++, p++, q++)
297 pthread_mutex_lock (pthMutexes + nP + j + 1);
299 pthread_mutex_unlock(pthMutexes + nP + j);
306 for (i=0; i<nZ; i++, p++, q++)
312 for (i=0; i<nZ; i++, p++, q++)
315 pthread_mutex_unlock(pthMutexes + nP + nX);
321 pthread_mutex_unlock(pthMutL);
324 pthread_mutex_unlock(pthMutexes + l);
349 return "SgEstimator";
356 tLastProcessed_(
tZero),
366 xByName_ =
new QMap<QString, SgParameter*>;
375 pByName_ =
new QMap<QString, SgParameter*>;
392 aByName_ =
new QMap<QString, SgParameter*>;
415 pthread_attr_setscope(&
pthreadAttr_, PTHREAD_SCOPE_SYSTEM);
427 "::SgEstimator(): the number of threads is set to " + QString(
"").setNum(
numOfThreads_) +
433 "::SgEstimator(): the the environmental variable \"" +
nsNumOfThreads +
434 "\" is set incorrectly: cannot convert \"" + str +
"\" to int");
436 "::SgEstimator(): the number of threads is " + QString(
"").setNum(
numOfThreads_));
441 "::SgEstimator(): using the default number of threads " + QString(
"").setNum(
numOfThreads_));
563 for (QMap<QString, StochasticSolutionCarrier>::iterator it=
stcSolutions_.begin();
567 for (
int i=0; i<stcSol.
list_->size(); i++)
568 delete stcSol.
list_->at(i);
664 ": addParameter(): the parameter is NULL");
670 ": addParameter(): the parameter [" + p->
getName() +
671 "] is already in the regular parameters map");
677 ": addParameter(): the parameter [" + p->
getName() +
678 "] is already in the stochastic parameters map");
684 ": addParameter(): the parameter [" + p->
getName() +
685 "] is already in the arc parameters map");
691 ": addParameter(): the parameter [" + p->
getName() +
692 "] is already in the PWL parameters map");
698 ": addParameter(): nZ_!=0; the parameter [" + p->
getName() +
733 ": addParametersList(): the parameters list is NULL");
736 for (
int i=0; i<l->size(); i++)
751 ": removeParameter(): the parameter is NULL");
757 ": removeParameter(): the parameter [" + p->
getName() +
758 "] is not in the regular parameters map");
764 ": removeParameter(): the parameter [" + p->
getName() +
765 "] is not in the stochastic parameters map");
771 ": removeParameter(): the parameter [" + p->
getName() +
772 "] is not in the arc parameters map");
778 ": removeParameter(): the parameter [" + p->
getName() +
779 "] is not in the PWL parameters map");
785 ": removeParameter(): nZ_!=0; the parameter [" + p->
getName() +
807 while (p->
getName() != l->at(idx)->getName())
817 ": removeParameter(): the parameter [" + p->
getName() +
818 "] is not in the parameters list");
831 ": removeParametersList(): the parameters list is NULL");
834 for (
int i=0; i<l->size(); i++)
851 ": prepare2Run(): size of the regular parameters list and its dictionary mismatch");
854 ": prepare2Run(): size of the stochastic parameters list and its dictionary mismatch");
857 ": prepare2Run(): size of the arc parameters list and its dictionary mismatch");
860 ": prepare2Run(): size of the PWL parameters list and its dictionary mismatch");
866 ": prepare2Run(): the size of the XAll parameters list is " + QString().setNum(
listXAll_->size()));
894 for (
unsigned int i=0; i<
nX_; i++)
912 for (
unsigned int i=0; i<
nP_; i++)
923 for (QMap<QString, StochasticSolutionCarrier>::iterator it=
stcSolutions_.begin();
927 for (
int i=0; i<stcSol.
list_->size(); i++)
928 delete stcSol.
list_->at(i);
940 nZ_ = numOfExpectedObs + 16;
1021 for (i=0; i<
nP_; i++)
1022 listP_->at(i)->resetStatistics();
1083 for (i=0; i<
nX_; i++)
1092 for (
int ii=0; ii<
listA_->size(); ii++)
1093 listA_->at(ii)->zerofy();
1094 for (
int ii=0; ii<
listPwl_->size(); ii++)
1099 for (i=0; i<
nP_; i++)
1129 for (i=0; i<
nX_; i++)
1135 for (
int ii=0; ii<
listA_->size(); ii++)
1136 listA_->at(ii)->zerofy();
1137 for (
int ii=0; ii<
listPwl_->size(); ii++)
1141 for (i=0; i<
nP_; i++)
1166 std::cout <<
"\n\n++++++ Saving processed parameters at epoch: "
1186 for (
int i=0; i<
listX_->size(); i++)
1194 if (tR < p->getTRight())
1208 mCol =
listX_->size() - mRow;
1211 std::cout <<
"saving processed parameters : splitted: " << mRow <<
" by " << mCol <<
"\n";
1220 for (
int i=0; i<mRow; i++)
1223 for (
int j=i; j<mRow; j++)
1225 for (
int j=0; j<mCol; j++)
1229 for (
int i=0; i<mCol; i++)
1232 for (
int j=i; j<mCol; j++)
1246 for (
int i=0; i<
listX_->size(); i++)
1249 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1250 std::cout <<
" X(before saving): " << qPrintable(str)
1255 std::cout <<
"matrix before:\n" << *
Rx_ <<
"\n";
1256 for (
int i=0; i<l->size(); i++)
1259 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1260 std::cout <<
" X(l): " << qPrintable(str)
1265 std::cout <<
" __saved: Rx_:\n" << *carrier.
Rx_ <<
"\n";
1266 std::cout <<
" __saved: Rxx_:\n" << *carrier.
Rxx_ <<
"\n";
1267 std::cout <<
" __saved: zx_:\n" << *carrier.
zx_ <<
"\n";
1272 std::cout <<
" pushed epoch: " << qPrintable(carrier.
tRight_.
toString()) <<
"\n";
1287 for (
int i=0; i<
listX_->size(); i++)
1290 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1291 std::cout <<
" X(after saving): " << qPrintable(str)
1296 std::cout <<
"matrix after:\n" << *
Rx_ <<
"\n";
1307 std::cout <<
"\n\n++++++ Inserting new parameters at epoch: "
1323 for (idx=0; idx<
listXAll_->size(); idx++)
1326 if (p->
getTLeft()<=t && t<p->getTRight())
1342 for (
int i=0; i<
listX_->size(); i++)
1345 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1346 std::cout <<
" list X_: " << qPrintable(str)
1352 for (
int i=0; i<n; i++)
1355 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1356 std::cout <<
" list l: " << qPrintable(str)
1361 std::cout <<
" l size: " << n
1369 int *idxs=
new int[
nX_];
1370 QMap<QString, int> idxByName;
1371 for (
int i=0; i<n; i++)
1373 idxByName.insert(l->at(i)->getName(), i);
1374 Rx_New->
setElement(i,i, 1.0/l->at(i)->getSigmaAPriori());
1376 for (
unsigned int i=0; i<
nX_; i++)
1378 if (idxByName.contains(
listX_->at(i)->getName()))
1380 idx = idxByName.find(
listX_->at(i)->getName()).value();
1383 else std::cout <<
"cannot find " << qPrintable(
listX_->at(i)->getName()) <<
"\n";
1386 for (
unsigned int i=0; i<
nX_; i++)
1389 for (
unsigned int j=i; j<
nX_; j++)
1394 for (
int i=0; i<
listX_->size(); i++)
1397 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1398 std::cout <<
" X(before inserting): " << qPrintable(str)
1403 std::cout <<
"matrix before:\n" << *
Rx_ <<
"\n";
1419 for (
int i=0; i<
listX_->size(); i++)
1422 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1423 std::cout <<
" X(after inserting): " << qPrintable(str)
1428 std::cout <<
"matrix after:\n" << *
Rx_ <<
"\n";
1437 double fNormOfR, fNormOfInv, k_F;
1439 fNormOfR = fNormOfInv = 0.0;
1442 for (
int i=0; i<n; i++)
1443 for (
int j=i; j<n; j++)
1445 fNormOfR += R. getElement(i, j)*R. getElement(i, j);
1448 fNormOfR = sqrt(fNormOfR);
1449 fNormOfInv= sqrt(fNormOfInv);
1450 k_F = fNormOfR*fNormOfInv;
1452 ": calcConditionNumber(): condition number: " + QString(
"").sprintf(
"k_F=%.6e with n=%d", k_F, n));
1464 SgMJD tWall4finisRun;
1484 std::cout <<
"nX_= " <<
nX_ <<
", rpStack_.size()=" <<
rpStack_.size() <<
"\n";
1489 std::cout <<
" === main sequence: Rx_:\n" << *
Rx_ <<
"\n";
1490 std::cout <<
" === main sequence: zx_:\n" << *
zx_ <<
"\n\n";
1504 for (
int i=0; i<
listX_->size(); i++)
1505 if (
listX_->at(i)->getTLeft() < tL)
1506 tL =
listX_->at(i)->getTLeft();
1510 std::cout <<
"solving x, arc's stack size is: " <<
rpStack_.size() <<
"\n";
1516 std::cout <<
" popped epoch: " << qPrintable(carrier.
tRight_.
toString()) <<
"\n";
1527 std::cout <<
" r->size(): " << r->size() <<
"\n";
1532 std::cout <<
" l->size(): " << l->size() <<
"\n";
1538 std::cout <<
"Processing batch for tR: " << qPrintable(tR.
toString()) <<
"\n";
1539 for (
int i=0; i<l->size(); i++)
1541 std::cout <<
"i=" << i <<
"\n";
1543 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1544 std::cout <<
" l-list: " << qPrintable(str)
1550 std::cout <<
" __restored: Rx_:\n" << *carrier.
Rx_ <<
"\n";
1551 std::cout <<
" __restored: Rxx_:\n" << *carrier.
Rxx_ <<
"\n";
1552 std::cout <<
" __restored: zx_:\n" << *carrier.
zx_ <<
"\n\n";
1579 std::cout <<
" The list of l-parameters:\n";
1580 for (
int i=0; i<l->size(); i++)
1583 std::cout <<
" l-list: "
1584 << qPrintable(QString().sprintf(
": [%2d] %s ", i, qPrintable(p->
getName())))
1589 std::cout <<
" The list of r-parameters:\n";
1590 for (
int i=0; i<r->size(); i++)
1593 std::cout <<
" r-list: "
1594 << qPrintable(QString().sprintf(
": [%2d] %s ", i, qPrintable(p->
getName())))
1600 std::cout <<
" RxInv:\n" << *RxInv <<
"\n";
1602 std::cout <<
" Rxxi:\n" << *Rxxi <<
"\n";
1606 std::cout <<
" Pd:\n" << *Pd <<
"\n";
1608 std::cout <<
" Pxx:\n" << *Pxx <<
"\n";
1617 while (!carrier.
list_->isEmpty())
1618 delete carrier.
list_->takeFirst();
1619 delete carrier.
list_;
1620 carrier.
list_ = NULL;
1631 delete carrier.
Rxx_;
1632 carrier.
Rxx_ = NULL;
1650 std::cout <<
" The list of all parameters:\n";
1654 std::cout <<
" XAll-list: "
1655 << qPrintable(QString().sprintf(
": [%2d] %s ", i, qPrintable(p->
getName())))
1661 std::cout <<
" Covariance matrix:\n" << *
PxAll_ <<
"\n";
1733 for (
int i=0; i<listP_saved->size(); i++)
1775 double t4solveEquation=0.0;
1777 double tcalculateRRT=0.0;
1778 double tcalcQForm1=0.0;
1779 double tcalcQForm2=0.0;
1943 for (l=0; l<
nP_; l++)
1946 for (i=0; i<
nZ_; i++)
1952 for (i=0; i<
nZ_; i++)
1956 for (j=l+1; j<
nP_; j++)
1959 for (i=0; i<
nZ_; i++)
1961 (*Rp_)(l,j) += s*g*ul;
1962 for (i=0; i<
nZ_; i++)
1965 for (j=0; j<
nX_; j++)
1968 for (i=0; i<
nZ_; i++)
1970 (*Rpx_)(l,j) += s*g*ul;
1971 for (i=0; i<
nZ_; i++)
1975 for (i=0; i<
nZ_; i++)
1977 (*zp_)(l) += s*g*ul;
1978 for (i=0; i<
nZ_; i++)
1985 for (l=0; l<
nX_; l++)
1988 for (i=0; i<
nZ_; i++)
1994 for (i=0; i<
nZ_; i++)
1998 for (j=l+1; j<
nX_; j++)
2001 for (i=0; i<
nZ_; i++)
2003 (*Rx_)(l,j) += s*g*ul;
2004 for (i=0; i<
nZ_; i++)
2008 for (i=0; i<
nZ_; i++)
2010 (*zx_)(l) += s*g*ul;
2011 for (i=0; i<
nZ_; i++)
2036 pthread_mutex_init(m, NULL);
2062 printf(
"create failed %d\n", rc);
2068 for (
int k=0; k<thIdx; k++)
2072 printf(
"join failed %d\n", rc);
2080 rc = pthread_join(*(
th4Prc_02_+thIdx), NULL);
2082 printf(
"join failed %d\n", rc);
2085 printf(
"create failed %d\n", rc);
2092 rc = pthread_join(*(
th4Prc_02_+thIdx), NULL);
2094 printf(
"join failed %d\n", rc);
2121 pthread_mutex_destroy(m);
2132 pthread_mutex_init(m, NULL);
2172 printf(
"create failed %d\n", rc);
2178 for (
int k=0; k<thIdx; k++)
2182 printf(
"join failed %d\n", rc);
2190 rc = pthread_join(*(
th4Prc_01_+thIdx), NULL);
2192 printf(
"join failed %d\n", rc);
2195 printf(
"create failed %d\n", rc);
2202 rc = pthread_join(*(
th4Prc_01_+thIdx), NULL);
2204 printf(
"join failed %d\n", rc);
2212 pthread_mutex_destroy(m);
2234 for (i=0; i<
nP_; i++)
2237 double mm = p->
calcM(dT);
2238 double rwn= p->
calcRW(dT);
2244 for (j=i; j<
nP_; j++)
2246 for (j=0; j<
nX_; j++)
2254 for (i=l, s=0.0; i<n; i++)
2260 for (i=l+1; i<n; i++)
2264 for (j=l+1; j<m+1; j++)
2266 for (i=l,g=0.0; i<n; i++)
2275 for (i=0; i<
nP_; i++)
2277 for (j=i; j<
nP_; j++)
2282 for (j=0; j<
nP_; j++)
2284 for (j=0; j<
nX_; j++)
2324 for (i=0; i<
nP_; i++)
2333 memcpy((
void*)(*(ppSR+m)+
nP_), (
void*)(pZp),
sizeof(
double)*(
nP_));
2335 for (j=0; j<
nP_; j++)
2336 memcpy((
void*)(*(ppSR+j)+
nP_), (
void*)(*(ppRp+j)),
sizeof(
double)*(j+1));
2338 for (j=0; j<
nX_; j++)
2339 memcpy((
void*)(*(ppSR+n+j)+
nP_), (
void*)(*(ppRpx+j)),
sizeof(
double)*(
nP_));
2347 for (i=l; i<n; i++, p++)
2351 s = -
signum(*(*(ppSR+l)+l))*sqrt(s);
2352 *(pU+l) = *(*(ppSR+l)+l) - s;
2353 memcpy((
void*)(pU+l+1), (
void*)(*(ppSR+l)+l+1),
sizeof(
double)*(n-l-1));
2355 s = 1.0/(s**(pU+l));
2356 for (j=l+1; j<m+1; j++)
2361 for (i=l; i<n; i++, p++, q++)
2365 for (i=l; i<n; i++, p++, q++)
2373 memcpy((
void*)(pZp), (
void*)(*(ppSR+m)+
nP_),
sizeof(
double)*(
nP_));
2375 memcpy((
void*)(pZp_s), (
void*)(*(ppSR+m) ),
sizeof(
double)*(
nP_));
2376 for (j=0; j<
nP_; j++)
2379 memcpy((
void*)(*(ppRp +j)), (
void*)(*(ppSR+
nP_+j)+
nP_),
sizeof(
double)*(j+1));
2381 memcpy((
void*)(*(ppRp_s +j)), (
void*)(*(ppSR+j)),
sizeof(
double)*(j+1));
2383 memcpy((
void*)(*(ppRpp_s+j)), (
void*)(*(ppSR+
nP_+j)),
sizeof(
double)*(
nP_));
2386 for (j=0; j<
nX_; j++)
2389 memcpy((
void*)(*(ppRpx+j)), (
void*)(*(ppSR+n+j)+
nP_),
sizeof(
double)*(
nP_));
2391 memcpy((
void*)(*(ppRpx_s+j)), (
void*)(*(ppSR+n+j)),
sizeof(
double)*(
nP_));
2405 for (
int i=0; i<
listP_->size(); i++)
2424 ": solveEquation(): incompatible ranges of vectors x and z");
2425 if (R.
nRow()!=x.
n())
2427 ": solveEquation(): incompatible ranges of vector x and matrix R");
2430 unsigned int i, j, n=x.
n()-1;
2440 ": solveEquation(): division by zero caused by R[N,N]=0");
2443 for (j=i, s=0.0; j<x.
n(); j++)
2449 ": solveEquation(): division by zero caused by R[j,j]=0");
2462 ": calculateRRT(): incompatible ranges of input matrices");
2466 unsigned int i, j, l;
2468 for (i=0; i<M.
nRow(); i++)
2469 for (j=i; j<M.
nCol(); j++)
2471 for (v=0.0, l=j; l<R.
nCol(); l++)
2555 ": calcQForm: incompatible ranges of the matrices");
2566 const double *
const * ppA=A.
base_c();
2567 const double *
const * ppP=P.
base_c();
2568 double **ppT=T.
base();
2569 double **ppS=S.
base();
2573 for (j=0; j<aNcol; j++)
2576 for (i=0; i<aNrow; i++, q++)
2580 for (k=0; k<j; k++, p++)
2581 s += *(*(ppA+k)+i)**p;
2582 for (k=j; k<aNcol; k++)
2583 s += *(*(ppA+k)+i)* *(*(ppP+k)+j);
2587 for (j=0; j<aNrow; j++)
2590 for (i=0; i<=j; i++, q++)
2593 for (k=0; k<aNcol; k++)
2594 s += *(*(ppT+k)+i)**(*(ppA+k)+j);
2601 for (i=0; i<aNrow; i++)
2602 for (j=0; j<aNcol; j++)
2604 for (k=0, s=0.0; k<aNcol; k++)
2608 for (i=0; i<aNrow; i++)
2609 for (j=i; j<aNrow; j++)
2611 for (k=0, s=0.0; k<aNcol; k++)
2629 ": calcQForm: incompatible ranges of the matrices");
2639 const double *
const * ppR=R.
base_c();
2640 const double *
const * ppP=P.
base_c();
2641 double **ppT=T.
base();
2642 double **ppS=S.
base();
2649 for (i=0; i<n; i++, q++)
2653 for (k=i; k<j; k++, p++)
2654 s += *(*(ppR+k)+i)**p;
2655 for (k=j; k<n; k++, p++)
2656 s += *(*(ppR+k)+i)**(*(ppP+k)+j);
2664 for (i=0; i<=j; i++, q++)
2668 s += *(*(ppT+k)+i)**(*(ppR+k)+j);
2678 for (k=i, s=0.0; k<n; k++)
2685 for (k=j, s=0.0; k<n; k++)
2703 for (
int i=0; i<stcPars->size(); i++)
2704 stcPars->at(i)->resetStatistics();
2711 for (
int i=0; i<stcSol.
list_->size(); i++)
2712 if (stcSol.
list_->at(i)->getNumObs())
2730 for (i=0; i<
nP_; i++)
2732 for (
int i=0; i<
listA_->size(); i++)
2734 for (
int i=0; i<
listPwl_->size(); i++)
2758 for (
int i=0; i<
listX_->size(); i++)
2767 sum +=
arcStorage_->at(i)->calcAX(t, isWorkingBand);
2771 sum +=
pwlStorage_->at(i)->calcAX(t, isWorkingBand);
2774 for (i=0; i<
nP_; i++)
2775 sum +=
listP_->at(i)->getD()*
listP_->at(i)->getSolution();
2787 for (
int i=0; i<
listA_->size(); i++)
2798 for (
int j=0; j<arcP->
getNum(); j++)
2803 ": deployArcParameters: deployed " + QString(
"").sprintf(
"%d", num) +
" single parameters");
2813 for (
int i=0; i<
listPwl_->size(); i++)
2846 ": deployPwlParameters: deployed " + QString(
"").sprintf(
"%d", num) +
" single parameters");
2873 pwlStorage_->at(i)->collectTraces4Sfo(listX, mPx);
2883 int *idxs=
new int[num];
2885 for (
int i=0; i<num; i++)
2886 idxs[i] = r->at(i)->getIdx();
2888 for (
int i=0; i<num; i++)
2895 ": collectDependentInfArray: trying to get a parameter (" + p->
getName() +
2896 ") that was not yet solved.");
2897 for (
int j=i; j<num; j++)
2909 int *idxs_x, n=xList->size();
2910 idxs_x =
new int[n];
2911 for (
int i=0; i<n; i++)
2912 idxs_x[i] = xList->at(i)->getIdx();
2915 for (
int i=0; i<n; i++)
2920 ": submittSolution2GlobalStore: trying to set up a parameter (" + p->
getName() +
2921 ") that was already solved.");
2932 for (
int i=0; i<n; i++)
2933 for (
int j=0; j<=i; j++)
2935 if (!(Pxx && others))
2941 int *idxs_o, m=others->size();
2942 idxs_o =
new int[m];
2943 for (
int i=0; i<m; i++)
2944 idxs_o[i] = others->at(i)->getIdx();
2945 for (
int i=0; i<n; i++)
2946 for (
int j=0; j<m; j++)
2962 for (
int i=0; i<n; i++)
2964 aT_P_a = *a*(*
PxAll_**a);
2978 bool *usedRows =
new bool[numAll];
2981 for (
int i=0; i<numAll; i++)
2982 usedRows[i] =
false;
2984 for (
int i=0; i<num; i++)
2985 usedRows[
listX_->at(i)->getIdx()] =
true;
2990 for (
int j=0; j<idx+1; j++)
2996 for (
int i=0; i<numAll; i++)
3001 for (
int j=0; j<num; j++)
3020 for (
int i=0; i<num; i++)
3028 aT_P_a +=
arcStorage_->at(j)->calc_aT_P_a(*vP_a, t);
3032 aT_P_a +=
pwlStorage_->at(i)->calc_aT_P_a(*vP_a, t);
3055 for (
int i=0; i<pars.size(); i++)
3079 loc2glb =
new int[num];
3082 for (
int i=0; i<pars.size(); i++)
3091 for (
int j=0; j<pwlActivePars.size(); j++)
3093 pp = pwlActivePars.at(j);
3095 loc2glb[idx] = pp->
getIdx();
3111 loc2glb[idx] = p->
getIdx();
3117 double aT_P_a(0.0), sum(0.0);
3120 for (
int i=0; i<num; i++)
3124 for (
int j=0; j<num; j++)
3138 for (
int i=0; i<num; i++)
const char * nsNumOfThreads
const SgMJD tZero(1957, 10, 4)
const SgMJD tInf(2100, 1, 1)
double signum(const double x)
SgMatrix calcProduct_mat_x_mat(const SgMatrix &M1, const SgMatrix &M2)
void reportParameterList(const QList< SgParameter * > &list, bool isShowTLeftRight)
bool lessThan4_ParameterByTRightSortingOrder(SgParameter *p1, SgParameter *p2)
void updateSolutionAtParameterList(QList< SgParameter * > &list, SgVector *x, SgSymMatrix *P)
bool lessThan4_ParameterByTLeftSortingOrder(SgParameter *p1, SgParameter *p2)
bool lessThan4_ParameterByNameSortingOrder(SgParameter *p1, SgParameter *p2)
void deployParameters(SgParameter *, const SgMJD &tStart, const SgMJD &tFinis, const SgMJD &tRefer)
bool isAttr(uint a) const
void solveStochasticParameters()
int lastPrcColumn4Prc_01_
SgEstimator(SgTaskConfig *)
void insertNewParameters(const SgMJD &)
struct arg4Prc_01 * args4Prc_01_
pthread_mutex_t * pthMutexes4Prc_02_
static const QString className()
int lastPrcColumn4Prc_02_
QList< SgParameter * > * listPwl_
void calcConditionNumber(const SgUtMatrix &R, const SgUtMatrix &RInv)
QStack< SmoothCarrier > scStack_
QList< SgPwlStorage * > * pwlStorage_
QMap< QString, SgParameter * > * xAllByName_
pthread_mutex_t * pthMutexes4Prc_01_
QList< SgParameter * > * listP_
double calcAX(const SgMJD &, bool)
void propagateStochasticParameters(double)
void removeParametersList(QList< SgParameter * > *)
void submittSolution2GlobalStore(SgSymMatrix *, QList< SgParameter * > *, SgMatrix *=NULL, QList< SgParameter * > *=NULL)
void saveProcessedParameters(const SgMJD &)
QList< SgParameter * > * listA_
SgSymMatrix & calculateRRT(SgSymMatrix &, const SgUtMatrix &)
QList< SgArcStorage * > * arcStorage_
double time4PropagateStc_
void propagateStochasticParameters_th(double)
SgVector & solveEquation(const SgUtMatrix &R, SgVector &x, const SgVector &z)
SgSymMatrix calcQForm(const SgSymMatrix &, const SgMatrix &)
void prepareStochasticSolution4Epoch(const SgMJD &, QList< SgParameter * > *)
double calc_aT_P_a(const SgMJD &)
void save4Smoothing(const SgMJD &)
void addParametersList(QList< SgParameter * > *, bool=false)
void propagateArcPartials(const SgMJD &)
QList< SgParameter * > * listXAll_
QMap< QString, SgParameter * > * xByName_
QMap< QString, SgParameter * > * pwlParByName_
void calcPwlTraces(const QList< SgParameter * > *listX, const SgSymMatrix &mPx)
void deployPwlParameters(const SgMJD &, const SgMJD &, const SgMJD &)
pthread_mutex_t pthMutL4Prc_01_
void addParameter(SgParameter *, bool=false)
double calc_aT_P_a_opt(const SgMJD &)
void prepare2Run(int numOfExpectedObs, const SgMJD &, const SgMJD &, const SgMJD &)
QMap< QString, SgParameter * > * pByName_
double maxConditionNumber_
QMap< QString, SgParameter * > * aByName_
void collectDependentInfArray(const RPCarrier &, SgVector *, SgSymMatrix *)
pthread_mutex_t pthMutL4Prc_02_
QMap< QString, SgPwlStorage * > * pwlStorageByName_
QMap< QString, StochasticSolutionCarrier > stcSolutions_
void processConstraint(double o_c, double sigma)
void removeParameter(SgParameter *)
void deployArcParameters(const SgMJD &, const SgMJD &, const SgMJD &)
void processObs(const SgMJD &t, const SgVector &o_c, const SgVector &sigma)
QList< SgParameter * > * listX_
void propagatePwlPartials(const SgMJD &)
pthread_attr_t pthreadAttr_
QStack< RPCarrier > rpStack_
struct arg4Prc_02 * args4Prc_02_
virtual void write(LogLevel, quint32, const QString &, bool=false)
bool isEligible(LogLevel lvl, quint32 f) const
@ F_YYYYMMDDHHMMSSSS
Long verbose: Fri, the 2nd of Apr, 2010; 17hr 02min 43.6400sec.
@ F_INTERNAL
Digits, date and time: 20100402.71.
QString toString(Format format=F_Verbose) const
static SgMJD currentMJD()
unsigned int nRow() const
void setElement(unsigned int i, unsigned int j, double d)
const double *const * base_c() const
double getElement(unsigned int i, unsigned int j) const
unsigned int nCol() const
double getSolution() const
SgParameterCfg::PMode getPMode() const
void setSolution(double v)
@ Attr_IS_SOLVED
for estimator use
void updateStatistics(const SgMJD &t, double weight)
const QString & getName() const
@ Attr_IS_SPECIAL
for estimator use
int getNumOfPolynomials() const
SgParameter * getP_Bi(int)
virtual void getListOfActiveParameters(const SgMJD &t, QList< SgParameter * > &pars)=0
int getNumOfNodes() const
SgParameter * getP_Ai(int)
int calcCurrentIdx(const SgMJD &t)
virtual void deployParameters(SgParameter *, const SgMJD &tStart, const SgMJD &tFinis, const SgMJD &tRefer, const SgTaskConfig *)=0
virtual int getNumOfActiveParameters(const SgMJD &t)=0
double getElement(unsigned int i, unsigned int j) const
const double *const * base_c() const
void setElement(unsigned int i, unsigned int j, double d)
EstimatorPwlMode getPwlMode() const
void setElement(unsigned int i, unsigned int j, double d)
const double *const * base_c() const
double getElement(unsigned int i, unsigned int j) const
void setElement(unsigned int i, double d)
double getElement(unsigned int i) const
QList< SgParameter * > * listOthers_
QList< SgParameter * > * list_
QList< SgParameter * > * p_s_
QList< SgParameter * > * list_
pthread_mutex_t * pthMutexes_
pthread_mutex_t * pthMutL_
pthread_mutex_t * pthMutexes_
pthread_mutex_t * pthMutL_