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);
433 "::SgEstimator(): the number of threads is set to " + QString(
"").setNum(
numOfThreads_) +
439 "::SgEstimator(): the the environmental variable \"" +
nsNumOfThreads +
440 "\" is set incorrectly: cannot convert \"" + str +
"\" to number of threads");
442 "::SgEstimator(): the number of threads is " + QString(
"").setNum(
numOfThreads_));
448 "::SgEstimator(): the the environmental variable \"" +
nsNumOfThreads +
449 "\" is set incorrectly: cannot convert \"" + str +
"\" to int");
451 "::SgEstimator(): the number of threads is " + QString(
"").setNum(
numOfThreads_));
456 "::SgEstimator(): using the default number of threads " + QString(
"").setNum(
numOfThreads_));
468 "::SgEstimator(): " + QString(
"").setNum(
numOfThreads_) +
" thread attributes were released");
580 for (QMap<QString, StochasticSolutionCarrier>::iterator it=
stcSolutions_.begin();
584 for (
int i=0; i<stcSol.
list_->size(); i++)
585 delete stcSol.
list_->at(i);
681 ": addParameter(): the parameter is NULL");
687 ": addParameter(): the parameter [" + p->
getName() +
688 "] is already in the regular parameters map");
694 ": addParameter(): the parameter [" + p->
getName() +
695 "] is already in the stochastic parameters map");
701 ": addParameter(): the parameter [" + p->
getName() +
702 "] is already in the arc parameters map");
708 ": addParameter(): the parameter [" + p->
getName() +
709 "] is already in the PWL parameters map");
715 ": addParameter(): nZ_!=0; the parameter [" + p->
getName() +
750 ": addParametersList(): the parameters list is NULL");
753 for (
int i=0; i<l->size(); i++)
768 ": removeParameter(): the parameter is NULL");
774 ": removeParameter(): the parameter [" + p->
getName() +
775 "] is not in the regular parameters map");
781 ": removeParameter(): the parameter [" + p->
getName() +
782 "] is not in the stochastic parameters map");
788 ": removeParameter(): the parameter [" + p->
getName() +
789 "] is not in the arc parameters map");
795 ": removeParameter(): the parameter [" + p->
getName() +
796 "] is not in the PWL parameters map");
802 ": removeParameter(): nZ_!=0; the parameter [" + p->
getName() +
824 while (p->
getName() != l->at(idx)->getName())
834 ": removeParameter(): the parameter [" + p->
getName() +
835 "] is not in the parameters list");
848 ": removeParametersList(): the parameters list is NULL");
851 for (
int i=0; i<l->size(); i++)
868 ": prepare2Run(): size of the regular parameters list and its dictionary mismatch");
871 ": prepare2Run(): size of the stochastic parameters list and its dictionary mismatch");
874 ": prepare2Run(): size of the arc parameters list and its dictionary mismatch");
877 ": prepare2Run(): size of the PWL parameters list and its dictionary mismatch");
883 ": prepare2Run(): the size of the XAll parameters list is " + QString().setNum(
listXAll_->size()));
911 for (
unsigned int i=0; i<
nX_; i++)
929 for (
unsigned int i=0; i<
nP_; i++)
940 for (QMap<QString, StochasticSolutionCarrier>::iterator it=
stcSolutions_.begin();
944 for (
int i=0; i<stcSol.
list_->size(); i++)
945 delete stcSol.
list_->at(i);
957 nZ_ = numOfExpectedObs + 16;
1038 for (i=0; i<
nP_; i++)
1039 listP_->at(i)->resetStatistics();
1100 for (i=0; i<
nX_; i++)
1109 for (
int ii=0; ii<
listA_->size(); ii++)
1110 listA_->at(ii)->zerofy();
1111 for (
int ii=0; ii<
listPwl_->size(); ii++)
1116 for (i=0; i<
nP_; i++)
1146 for (i=0; i<
nX_; i++)
1152 for (
int ii=0; ii<
listA_->size(); ii++)
1153 listA_->at(ii)->zerofy();
1154 for (
int ii=0; ii<
listPwl_->size(); ii++)
1158 for (i=0; i<
nP_; i++)
1183 std::cout <<
"\n\n++++++ Saving processed parameters at epoch: "
1203 for (
int i=0; i<
listX_->size(); i++)
1211 if (tR < p->getTRight())
1225 mCol =
listX_->size() - mRow;
1228 std::cout <<
"saving processed parameters : splitted: " << mRow <<
" by " << mCol <<
"\n";
1237 for (
int i=0; i<mRow; i++)
1240 for (
int j=i; j<mRow; j++)
1242 for (
int j=0; j<mCol; j++)
1246 for (
int i=0; i<mCol; i++)
1249 for (
int j=i; j<mCol; j++)
1263 for (
int i=0; i<
listX_->size(); i++)
1266 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1267 std::cout <<
" X(before saving): " << qPrintable(str)
1272 std::cout <<
"matrix before:\n" << *
Rx_ <<
"\n";
1273 for (
int i=0; i<l->size(); i++)
1276 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1277 std::cout <<
" X(l): " << qPrintable(str)
1282 std::cout <<
" __saved: Rx_:\n" << *carrier.
Rx_ <<
"\n";
1283 std::cout <<
" __saved: Rxx_:\n" << *carrier.
Rxx_ <<
"\n";
1284 std::cout <<
" __saved: zx_:\n" << *carrier.
zx_ <<
"\n";
1289 std::cout <<
" pushed epoch: " << qPrintable(carrier.
tRight_.
toString()) <<
"\n";
1304 for (
int i=0; i<
listX_->size(); i++)
1307 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1308 std::cout <<
" X(after saving): " << qPrintable(str)
1313 std::cout <<
"matrix after:\n" << *
Rx_ <<
"\n";
1324 std::cout <<
"\n\n++++++ Inserting new parameters at epoch: "
1340 for (idx=0; idx<
listXAll_->size(); idx++)
1343 if (p->
getTLeft()<=t && t<p->getTRight())
1359 for (
int i=0; i<
listX_->size(); i++)
1362 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1363 std::cout <<
" list X_: " << qPrintable(str)
1369 for (
int i=0; i<n; i++)
1372 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1373 std::cout <<
" list l: " << qPrintable(str)
1378 std::cout <<
" l size: " << n
1386 int *idxs=
new int[
nX_];
1387 QMap<QString, int> idxByName;
1388 for (
int i=0; i<n; i++)
1390 idxByName.insert(l->at(i)->getName(), i);
1391 Rx_New->
setElement(i,i, 1.0/l->at(i)->getSigmaAPriori());
1393 for (
unsigned int i=0; i<
nX_; i++)
1395 if (idxByName.contains(
listX_->at(i)->getName()))
1397 idx = idxByName.find(
listX_->at(i)->getName()).value();
1400 else std::cout <<
"cannot find " << qPrintable(
listX_->at(i)->getName()) <<
"\n";
1403 for (
unsigned int i=0; i<
nX_; i++)
1406 for (
unsigned int j=i; j<
nX_; j++)
1411 for (
int i=0; i<
listX_->size(); i++)
1414 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1415 std::cout <<
" X(before inserting): " << qPrintable(str)
1420 std::cout <<
"matrix before:\n" << *
Rx_ <<
"\n";
1436 for (
int i=0; i<
listX_->size(); i++)
1439 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1440 std::cout <<
" X(after inserting): " << qPrintable(str)
1445 std::cout <<
"matrix after:\n" << *
Rx_ <<
"\n";
1454 double fNormOfR, fNormOfInv, k_F;
1456 fNormOfR = fNormOfInv = 0.0;
1459 for (
int i=0; i<n; i++)
1460 for (
int j=i; j<n; j++)
1462 fNormOfR += R. getElement(i, j)*R. getElement(i, j);
1465 fNormOfR = sqrt(fNormOfR);
1466 fNormOfInv= sqrt(fNormOfInv);
1467 k_F = fNormOfR*fNormOfInv;
1469 ": calcConditionNumber(): condition number: " + QString(
"").sprintf(
"k_F=%.6e with n=%d", k_F, n));
1481 SgMJD tWall4finisRun;
1501 std::cout <<
"nX_= " <<
nX_ <<
", rpStack_.size()=" <<
rpStack_.size() <<
"\n";
1506 std::cout <<
" === main sequence: Rx_:\n" << *
Rx_ <<
"\n";
1507 std::cout <<
" === main sequence: zx_:\n" << *
zx_ <<
"\n\n";
1521 for (
int i=0; i<
listX_->size(); i++)
1522 if (
listX_->at(i)->getTLeft() < tL)
1523 tL =
listX_->at(i)->getTLeft();
1527 std::cout <<
"solving x, arc's stack size is: " <<
rpStack_.size() <<
"\n";
1533 std::cout <<
" popped epoch: " << qPrintable(carrier.
tRight_.
toString()) <<
"\n";
1544 std::cout <<
" r->size(): " << r->size() <<
"\n";
1549 std::cout <<
" l->size(): " << l->size() <<
"\n";
1555 std::cout <<
"Processing batch for tR: " << qPrintable(tR.
toString()) <<
"\n";
1556 for (
int i=0; i<l->size(); i++)
1558 std::cout <<
"i=" << i <<
"\n";
1560 str.sprintf(
": [%2d] %s ", i, qPrintable(p->
getName()));
1561 std::cout <<
" l-list: " << qPrintable(str)
1567 std::cout <<
" __restored: Rx_:\n" << *carrier.
Rx_ <<
"\n";
1568 std::cout <<
" __restored: Rxx_:\n" << *carrier.
Rxx_ <<
"\n";
1569 std::cout <<
" __restored: zx_:\n" << *carrier.
zx_ <<
"\n\n";
1596 std::cout <<
" The list of l-parameters:\n";
1597 for (
int i=0; i<l->size(); i++)
1600 std::cout <<
" l-list: "
1601 << qPrintable(QString().sprintf(
": [%2d] %s ", i, qPrintable(p->
getName())))
1606 std::cout <<
" The list of r-parameters:\n";
1607 for (
int i=0; i<r->size(); i++)
1610 std::cout <<
" r-list: "
1611 << qPrintable(QString().sprintf(
": [%2d] %s ", i, qPrintable(p->
getName())))
1617 std::cout <<
" RxInv:\n" << *RxInv <<
"\n";
1619 std::cout <<
" Rxxi:\n" << *Rxxi <<
"\n";
1623 std::cout <<
" Pd:\n" << *Pd <<
"\n";
1625 std::cout <<
" Pxx:\n" << *Pxx <<
"\n";
1634 while (!carrier.
list_->isEmpty())
1635 delete carrier.
list_->takeFirst();
1636 delete carrier.
list_;
1637 carrier.
list_ = NULL;
1648 delete carrier.
Rxx_;
1649 carrier.
Rxx_ = NULL;
1667 std::cout <<
" The list of all parameters:\n";
1671 std::cout <<
" XAll-list: "
1672 << qPrintable(QString().sprintf(
": [%2d] %s ", i, qPrintable(p->
getName())))
1678 std::cout <<
" Covariance matrix:\n" << *
PxAll_ <<
"\n";
1750 for (
int i=0; i<listP_saved->size(); i++)
1792 double t4solveEquation=0.0;
1794 double tcalculateRRT=0.0;
1795 double tcalcQForm1=0.0;
1796 double tcalcQForm2=0.0;
1960 for (l=0; l<
nP_; l++)
1963 for (i=0; i<
nZ_; i++)
1969 for (i=0; i<
nZ_; i++)
1973 for (j=l+1; j<
nP_; j++)
1976 for (i=0; i<
nZ_; i++)
1978 (*Rp_)(l,j) += s*g*ul;
1979 for (i=0; i<
nZ_; i++)
1982 for (j=0; j<
nX_; j++)
1985 for (i=0; i<
nZ_; i++)
1987 (*Rpx_)(l,j) += s*g*ul;
1988 for (i=0; i<
nZ_; i++)
1992 for (i=0; i<
nZ_; i++)
1994 (*zp_)(l) += s*g*ul;
1995 for (i=0; i<
nZ_; i++)
2002 for (l=0; l<
nX_; l++)
2005 for (i=0; i<
nZ_; i++)
2011 for (i=0; i<
nZ_; i++)
2015 for (j=l+1; j<
nX_; j++)
2018 for (i=0; i<
nZ_; i++)
2020 (*Rx_)(l,j) += s*g*ul;
2021 for (i=0; i<
nZ_; i++)
2025 for (i=0; i<
nZ_; i++)
2027 (*zx_)(l) += s*g*ul;
2028 for (i=0; i<
nZ_; i++)
2053 pthread_mutex_init(m, NULL);
2079 printf(
"create failed %d\n", rc);
2085 for (
int k=0; k<thIdx; k++)
2089 printf(
"join failed %d\n", rc);
2097 rc = pthread_join(*(
th4Prc_02_+thIdx), NULL);
2099 printf(
"join failed %d\n", rc);
2102 printf(
"create failed %d\n", rc);
2109 rc = pthread_join(*(
th4Prc_02_+thIdx), NULL);
2111 printf(
"join failed %d\n", rc);
2138 pthread_mutex_destroy(m);
2149 pthread_mutex_init(m, NULL);
2189 printf(
"create failed %d\n", rc);
2195 for (
int k=0; k<thIdx; k++)
2199 printf(
"join failed %d\n", rc);
2207 rc = pthread_join(*(
th4Prc_01_+thIdx), NULL);
2209 printf(
"join failed %d\n", rc);
2212 printf(
"create failed %d\n", rc);
2219 rc = pthread_join(*(
th4Prc_01_+thIdx), NULL);
2221 printf(
"join failed %d\n", rc);
2229 pthread_mutex_destroy(m);
2251 for (i=0; i<
nP_; i++)
2254 double mm = p->
calcM(dT);
2255 double rwn= p->
calcRW(dT);
2261 for (j=i; j<
nP_; j++)
2263 for (j=0; j<
nX_; j++)
2271 for (i=l, s=0.0; i<n; i++)
2277 for (i=l+1; i<n; i++)
2281 for (j=l+1; j<m+1; j++)
2283 for (i=l,g=0.0; i<n; i++)
2292 for (i=0; i<
nP_; i++)
2294 for (j=i; j<
nP_; j++)
2299 for (j=0; j<
nP_; j++)
2301 for (j=0; j<
nX_; j++)
2341 for (i=0; i<
nP_; i++)
2350 memcpy((
void*)(*(ppSR+m)+
nP_), (
void*)(pZp),
sizeof(
double)*(
nP_));
2352 for (j=0; j<
nP_; j++)
2353 memcpy((
void*)(*(ppSR+j)+
nP_), (
void*)(*(ppRp+j)),
sizeof(
double)*(j+1));
2355 for (j=0; j<
nX_; j++)
2356 memcpy((
void*)(*(ppSR+n+j)+
nP_), (
void*)(*(ppRpx+j)),
sizeof(
double)*(
nP_));
2364 for (i=l; i<n; i++, p++)
2368 s = -
signum(*(*(ppSR+l)+l))*sqrt(s);
2369 *(pU+l) = *(*(ppSR+l)+l) - s;
2370 memcpy((
void*)(pU+l+1), (
void*)(*(ppSR+l)+l+1),
sizeof(
double)*(n-l-1));
2372 s = 1.0/(s**(pU+l));
2373 for (j=l+1; j<m+1; j++)
2378 for (i=l; i<n; i++, p++, q++)
2382 for (i=l; i<n; i++, p++, q++)
2390 memcpy((
void*)(pZp), (
void*)(*(ppSR+m)+
nP_),
sizeof(
double)*(
nP_));
2392 memcpy((
void*)(pZp_s), (
void*)(*(ppSR+m) ),
sizeof(
double)*(
nP_));
2393 for (j=0; j<
nP_; j++)
2396 memcpy((
void*)(*(ppRp +j)), (
void*)(*(ppSR+
nP_+j)+
nP_),
sizeof(
double)*(j+1));
2398 memcpy((
void*)(*(ppRp_s +j)), (
void*)(*(ppSR+j)),
sizeof(
double)*(j+1));
2400 memcpy((
void*)(*(ppRpp_s+j)), (
void*)(*(ppSR+
nP_+j)),
sizeof(
double)*(
nP_));
2403 for (j=0; j<
nX_; j++)
2406 memcpy((
void*)(*(ppRpx+j)), (
void*)(*(ppSR+n+j)+
nP_),
sizeof(
double)*(
nP_));
2408 memcpy((
void*)(*(ppRpx_s+j)), (
void*)(*(ppSR+n+j)),
sizeof(
double)*(
nP_));
2422 for (
int i=0; i<
listP_->size(); i++)
2441 ": solveEquation(): incompatible ranges of vectors x and z");
2442 if (R.
nRow()!=x.
n())
2444 ": solveEquation(): incompatible ranges of vector x and matrix R");
2447 unsigned int i, j, n=x.
n()-1;
2457 ": solveEquation(): division by zero caused by R[N,N]=0");
2460 for (j=i, s=0.0; j<x.
n(); j++)
2466 ": solveEquation(): division by zero caused by R[j,j]=0");
2479 ": calculateRRT(): incompatible ranges of input matrices");
2483 unsigned int i, j, l;
2485 for (i=0; i<M.
nRow(); i++)
2486 for (j=i; j<M.
nCol(); j++)
2488 for (v=0.0, l=j; l<R.
nCol(); l++)
2572 ": calcQForm: incompatible ranges of the matrices");
2583 const double *
const * ppA=A.
base_c();
2584 const double *
const * ppP=P.
base_c();
2585 double **ppT=T.
base();
2586 double **ppS=S.
base();
2590 for (j=0; j<aNcol; j++)
2593 for (i=0; i<aNrow; i++, q++)
2597 for (k=0; k<j; k++, p++)
2598 s += *(*(ppA+k)+i)**p;
2599 for (k=j; k<aNcol; k++)
2600 s += *(*(ppA+k)+i)* *(*(ppP+k)+j);
2604 for (j=0; j<aNrow; j++)
2607 for (i=0; i<=j; i++, q++)
2610 for (k=0; k<aNcol; k++)
2611 s += *(*(ppT+k)+i)**(*(ppA+k)+j);
2618 for (i=0; i<aNrow; i++)
2619 for (j=0; j<aNcol; j++)
2621 for (k=0, s=0.0; k<aNcol; k++)
2625 for (i=0; i<aNrow; i++)
2626 for (j=i; j<aNrow; j++)
2628 for (k=0, s=0.0; k<aNcol; k++)
2646 ": calcQForm: incompatible ranges of the matrices");
2656 const double *
const * ppR=R.
base_c();
2657 const double *
const * ppP=P.
base_c();
2658 double **ppT=T.
base();
2659 double **ppS=S.
base();
2666 for (i=0; i<n; i++, q++)
2670 for (k=i; k<j; k++, p++)
2671 s += *(*(ppR+k)+i)**p;
2672 for (k=j; k<n; k++, p++)
2673 s += *(*(ppR+k)+i)**(*(ppP+k)+j);
2681 for (i=0; i<=j; i++, q++)
2685 s += *(*(ppT+k)+i)**(*(ppR+k)+j);
2695 for (k=i, s=0.0; k<n; k++)
2702 for (k=j, s=0.0; k<n; k++)
2720 for (
int i=0; i<stcPars->size(); i++)
2721 stcPars->at(i)->resetStatistics();
2728 for (
int i=0; i<stcSol.
list_->size(); i++)
2729 if (stcSol.
list_->at(i)->getNumObs())
2747 for (i=0; i<
nP_; i++)
2749 for (
int i=0; i<
listA_->size(); i++)
2751 for (
int i=0; i<
listPwl_->size(); i++)
2775 for (
int i=0; i<
listX_->size(); i++)
2784 sum +=
arcStorage_->at(i)->calcAX(t, isWorkingBand);
2788 sum +=
pwlStorage_->at(i)->calcAX(t, isWorkingBand);
2791 for (i=0; i<
nP_; i++)
2792 sum +=
listP_->at(i)->getD()*
listP_->at(i)->getSolution();
2804 for (
int i=0; i<
listA_->size(); i++)
2815 for (
int j=0; j<arcP->
getNum(); j++)
2820 ": deployArcParameters: deployed " + QString(
"").sprintf(
"%d", num) +
" single parameters");
2830 for (
int i=0; i<
listPwl_->size(); i++)
2863 ": deployPwlParameters: deployed " + QString(
"").sprintf(
"%d", num) +
" single parameters");
2890 pwlStorage_->at(i)->collectTraces4Sfo(listX, mPx);
2900 int *idxs=
new int[num];
2902 for (
int i=0; i<num; i++)
2903 idxs[i] = r->at(i)->getIdx();
2905 for (
int i=0; i<num; i++)
2912 ": collectDependentInfArray: trying to get a parameter (" + p->
getName() +
2913 ") that was not yet solved.");
2914 for (
int j=i; j<num; j++)
2926 int *idxs_x, n=xList->size();
2927 idxs_x =
new int[n];
2928 for (
int i=0; i<n; i++)
2929 idxs_x[i] = xList->at(i)->getIdx();
2932 for (
int i=0; i<n; i++)
2937 ": submittSolution2GlobalStore: trying to set up a parameter (" + p->
getName() +
2938 ") that was already solved.");
2949 for (
int i=0; i<n; i++)
2950 for (
int j=0; j<=i; j++)
2952 if (!(Pxx && others))
2958 int *idxs_o, m=others->size();
2959 idxs_o =
new int[m];
2960 for (
int i=0; i<m; i++)
2961 idxs_o[i] = others->at(i)->getIdx();
2962 for (
int i=0; i<n; i++)
2963 for (
int j=0; j<m; j++)
2979 for (
int i=0; i<n; i++)
2981 aT_P_a = *a*(*
PxAll_**a);
2995 bool *usedRows =
new bool[numAll];
2998 for (
int i=0; i<numAll; i++)
2999 usedRows[i] =
false;
3001 for (
int i=0; i<num; i++)
3002 usedRows[
listX_->at(i)->getIdx()] =
true;
3007 for (
int j=0; j<idx+1; j++)
3013 for (
int i=0; i<numAll; i++)
3018 for (
int j=0; j<num; j++)
3037 for (
int i=0; i<num; i++)
3045 aT_P_a +=
arcStorage_->at(j)->calc_aT_P_a(*vP_a, t);
3049 aT_P_a +=
pwlStorage_->at(i)->calc_aT_P_a(*vP_a, t);
3072 for (
int i=0; i<pars.size(); i++)
3096 loc2glb =
new int[num];
3099 for (
int i=0; i<pars.size(); i++)
3108 for (
int j=0; j<pwlActivePars.size(); j++)
3110 pp = pwlActivePars.at(j);
3112 loc2glb[idx] = pp->
getIdx();
3128 loc2glb[idx] = p->
getIdx();
3134 double aT_P_a(0.0), sum(0.0);
3137 for (
int i=0; i<num; i++)
3141 for (
int j=0; j<num; j++)
3155 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_