Changeset 823 for soft/giet_vm/applications/rosenfeld/src-par/mca.c
- Timestamp:
- Jun 14, 2016, 5:23:56 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/src-par/mca.c
r822 r823 98 98 99 99 100 // ----------------------------------------------- 100 // ------------------------------------------------ 101 101 void MCA_Set_Size(MCA * mca, int width, int height) 102 // ----------------------------------------------- 102 // ------------------------------------------------ 103 103 { 104 104 MCA_Set_Width(mca, width); … … 107 107 108 108 109 // ---------------------------------------------------- 109 // ----------------------------------------------------- 110 110 void MCA_Set_Dimension(MCA * mca, int width, int height) 111 // ---------------------------------------------------- 111 // ----------------------------------------------------- 112 112 { 113 113 MCA_Set_Width(mca, width); … … 116 116 117 117 118 // ------------------------------ 118 // ------------------------------- 119 119 void MCA_Set_NP(MCA * mca, int np) 120 // ------------------------------ 120 // ------------------------------- 121 121 { 122 122 mca->np = np; 123 123 } 124 125 126 // ------------------------------- 127 void MCA_Set_NR(MCA * mca, int nr) 128 // ------------------------------- 129 { 130 mca->nr = nr; 131 } 132 124 133 125 134 … … 146 155 // input 147 156 int np = mca->np; 157 int nr = mca->nr; 148 158 int width = mca->width; 149 159 int height = mca->height; … … 292 302 mca_par->e0 = e0_par; 293 303 mca_par->e1 = e1_par; 304 // à la premiÚre itération, on remet à 0 toute la table T 305 mca_par->ne_prev = e1_par; 294 306 mca_par->alpha = pw2; 295 307 mca_par->np = np; 308 mca_par->nr = nr; 296 309 // Pour les barriÚres pyramidales 297 310 mca_par->nb_level = nb_level; … … 311 324 mca_par->E = remote_dist_ui32matrix(i0_par, i1_par, 0, width - 1, x, y); // distributed matrix with border 312 325 313 if (p == 0) { 314 mca_par->T = remote_ui32vector(e0_par - 1, e1_par, x, y); // car e0 = 1, on a besoin que T[0] = 0 pour FindRoot 315 mca_par->stats = remote_RegionStatsVector(e0_par - 1, e1_par, x, y); 316 } 317 else { 318 mca_par->T = remote_ui32vector(e0_par, e1_par, x, y); 319 mca_par->stats = remote_RegionStatsVector(e0_par, e1_par, x, y); 320 } 326 mca_par->T = remote_ui32vector(e0_par, e1_par, x, y); 327 mca_par->stats = remote_RegionStatsVector(e0_par, e1_par, x, y); 321 328 322 329 mca_par->D = (uint32 **) remote_vvector(0, np - 1, x, y); … … 326 333 mca_par->E = dist_ui32matrix(i0_par, i1_par, 0, width - 1); // distributed matrix with border 327 334 328 if (p == 0) { 329 mca_par->T = ui32vector(e0_par - 1, e1_par); // car e0 = 1, on a besoin que T[0] = 0 pour FindRoot 330 mca_par->stats = RegionStatsVector(e0_par - 1, e1_par); 331 } 332 else { 333 mca_par->T = ui32vector(e0_par, e1_par); 334 mca_par->stats = RegionStatsVector(e0_par, e1_par); 335 } 335 mca_par->T = ui32vector(e0_par, e1_par); 336 mca_par->stats = RegionStatsVector(e0_par, e1_par); 336 337 337 338 mca_par->D = (uint32 **) vvector(0, np - 1); … … 353 354 354 355 MCA_VERBOSE3(printf("p = %d T[%d..%d]\n", p, e0, e1)); 355 if (p == 0) { 356 set_ui32vector_j(T, e0 - 1, e1); // car e0 = 1, on a besoin que T[0] = 0 pour FindRoot 357 } 358 else { 359 set_ui32vector_j(T, e0, e1); 360 } 361 MCA_VERBOSE3(printf("\n")); 356 set_ui32vector_j(T, e0, e1); 362 357 } 363 358 … … 371 366 372 367 MCA_VERBOSE3(printf("p = %d T[%d..%d]\n", p, e0, e1)); 373 if (p == 0) { 374 MCA_VERBOSE3(display_ui32vector_number(T, e0 - 1, e0 + 10, "%5d", "T")); 375 } 376 else { 377 MCA_VERBOSE3(display_ui32vector_number(T, e0, e0 + 10, "%5d", "T")); 378 } 368 MCA_VERBOSE3(display_ui32vector_number(T, e0, e0 + 10, "%5d", "T")); 379 369 MCA_VERBOSE3(printf("\n")); 380 370 } … … 506 496 free_dist_ui32matrix(mca_par->E, i0, i1, j0, j1); 507 497 508 if (p == 0) { 509 free_ui32vector(mca_par->T, e0 - 1, e1); // car e0 = 1, on a besoin que T[0] = 0 pour FindRoot 510 free_RegionStatsVector(mca_par->stats, e0 - 1, e1); 511 } 512 else { 513 free_ui32vector(mca_par->T, e0, e1); 514 free_RegionStatsVector(mca_par->stats, e0, e1); 515 } 498 free_ui32vector(mca_par->T, e0, e1); 499 free_RegionStatsVector(mca_par->stats, e0, e1); 516 500 517 501 free_vvector((void **) mca_par->D, 0, np - 1);
Note: See TracChangeset
for help on using the changeset viewer.