Changeset 36197
- Timestamp:
- Oct 9, 2013, 4:11:54 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130904/psLib/src/math
- Files:
-
- 2 edited
-
psEllipse.c (modified) (1 diff)
-
psMixtureModels.c (modified) (7 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/psLib/src/math/psEllipse.c
r36149 r36197 224 224 double p = PS_SQR(pol.e0) + PS_SQR(q) - 2.0*q*pol.e0; 225 225 226 double f1 = 4*pol.e0 / p;227 double f2 = 4*q/ p;226 // double f1 = 4*pol.e0 / p; 227 // double f2 = 4*q / p; 228 228 229 229 double sxr = 2.0*(pol.e0 - pol.e1) / p; -
branches/eam_branches/ipp-20130904/psLib/src/math/psMixtureModels.c
- Property svn:mergeinfo changed
/trunk/psLib/src/math/psMixtureModels.c (added) merged: 36180
r36082 r36197 198 198 psVectorInit(modes,NAN); 199 199 for (int i = 0; i < N - Ncensored; i++) { 200 modes->data.F32[i -offsets->data.S32[i]] = tempModes->data.F32[i];200 modes->data.F32[i + offsets->data.S32[i]] = tempModes->data.F32[i]; 201 201 } 202 202 psFree(tempModes); … … 418 418 } 419 419 if (!P) { 420 P = psImageAlloc( N,m,PS_TYPE_F32);420 P = psImageAlloc(m,N,PS_TYPE_F32); 421 421 } 422 422 psVectorInit(modes,NAN); … … 424 424 425 425 for (int i = 0; i < N - Ncensored; i++) { 426 modes->data.F32[i -offsets->data.S32[i]] = tempModes->data.F32[i];426 modes->data.F32[i + offsets->data.S32[i]] = tempModes->data.F32[i]; 427 427 for (int j = 0; j < dim; j++) { 428 P->data.F32[i -offsets->data.S32[i]][j] = tempP->data.F32[i][j];428 P->data.F32[i + offsets->data.S32[i]][j] = tempP->data.F32[i][j]; 429 429 } 430 430 } … … 511 511 } 512 512 for (i = 0; i < m; i++) { 513 pi->data.F32[i] = counts->data.F32[i] / N; 513 //pi->data.F32[i] = counts->data.F32[i] / (1.0 * N); 514 pi->data.F32[i] = 0.5; 514 515 } 515 516 … … 539 540 for (j = 0; j < dim; j++) { // VV 540 541 M->data.F32[j] = means->data.F32[i][j]; 541 } 542 // printf("%f %f %f\n", 543 // X->data.F32[j],M->data.F32[j], 544 // S->data.F32[j][j]); 545 } 546 542 547 543 548 P->data.F32[k][i] = … … 545 550 546 551 logL += log(P->data.F32[k][i]); 552 // printf("%d %d %f %f %f %f\n", 553 // k,i, 554 // pi->data.F32[i], 555 // psMMNDGaussian(X,M,S), 556 // P->data.F32[k][i],logL); 547 557 norm_K += P->data.F32[k][i]; 548 558 } … … 612 622 } 613 623 } 614 } 624 } 625 // printf("%d %f %f %f %f\n",*iterations,logL,oldlogL,means->data.F32[0][0],means->data.F32[1][0]); 626 *iterations = *iterations + 1; 615 627 } while ((logL - oldlogL > 0)&& 616 628 (*iterations < MAX_ITERATIONS)); - Property svn:mergeinfo changed
Note:
See TracChangeset
for help on using the changeset viewer.
