Changeset 12232
- Timestamp:
- 05/10/12 16:54:05 (13 years ago)
- Location:
- issm/trunk-jpl/src/c/modules/Krigingx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
r12231 r12232 64 64 gate.variogram = variogram; 65 65 gate.observations = observations; 66 gate.predictions = predictions; 66 gate.predictions = predictions; 67 gate.percent = (double*)xcalloc(num,sizeof(double)); 67 68 68 69 /*launch the thread manager with Krigingxt as a core: */ 69 70 LaunchThread(Krigingxt,(void*)&gate,num); 71 printf("\r interpolation progress: 100.00%%\n"); 72 xfree((void**)&gate.percent); 70 73 } 71 74 else{ … … 104 107 Observations *observations = gate->observations; 105 108 double *predictions = gate->predictions; 109 double *percent = gate->percent; 106 110 107 111 /*Intermediaries*/ 108 112 int i,j,n_obs; 109 double numerator,denominator,ratio ;113 double numerator,denominator,ratio,localpercent; 110 114 double *x = NULL; 111 115 double *y = NULL; … … 119 123 120 124 /*partition loop across threads: */ 121 if(my_thread==0) printf(" interpolation progress: %5.2lf %%",0.0);122 125 PartitionRange(&i0,&i1,n_interp,num_threads,my_thread); 123 126 for(int idx=i0;idx<i1;idx++){ 124 if(my_thread==0 && idx%10==0) printf("\b\b\b\b\b\b\b%5.2lf %%",double(idx-i0)/double(i1-i0)*100); 127 128 /*Print info*/ 129 percent[my_thread]=double(idx-i0)/double(i1-i0)*100.; 130 localpercent=percent[0]; 131 for(i=1;i<num_threads;i++) localpercent=min(localpercent,percent[i]); 132 printf("\r interpolation progress: %5.2lf%%",localpercent); 125 133 126 134 /*Get list of observations for current point*/ … … 128 136 129 137 /*Allocate intermediary matrix and vectors*/ 130 Gamma =(double*)xmalloc(n_obs*n_obs*sizeof(double));131 gamma0 =(double*)xmalloc(n_obs*sizeof(double));132 ones =(double*)xmalloc(n_obs*sizeof(double));138 Gamma = (double*)xmalloc(n_obs*n_obs*sizeof(double)); 139 gamma0 = (double*)xmalloc(n_obs*sizeof(double)); 140 ones = (double*)xmalloc(n_obs*sizeof(double)); 133 141 134 142 /*First: Create semivariogram matrix for observations*/ … … 169 177 xfree((void**)&GinvZ); 170 178 } 171 if(my_thread==0) printf("\b\b\b\b\b\b\b\b%5.2lf %%\n",100.0);172 179 173 180 return NULL; -
issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.h
r12231 r12232 25 25 Observations *observations; 26 26 double *predictions; 27 double *percent; 27 28 }KrigingxThreadStruct; 28 29
Note:
See TracChangeset
for help on using the changeset viewer.