Changeset 12229 for issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
- Timestamp:
- 05/10/12 10:41:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
r12226 r12229 23 23 /*Intermediaries*/ 24 24 int i,j,n_obs; 25 double range; 25 26 double numerator,denominator,ratio; 26 27 double *x = NULL; … … 33 34 double *gamma0 = NULL; 34 35 double *ones = NULL; 36 char *output = NULL; 35 37 Variogram *variogram = NULL; 36 38 Observations *observations = NULL; … … 38 40 /*Get Variogram from Options*/ 39 41 ProcessVariogram(&variogram,options); 42 options->Get(&range,"searchrange",0.); 40 43 41 44 /*Process observation dataset*/ … … 44 47 /*Allocation output*/ 45 48 predictions =(double*)xmalloc(n_interp*sizeof(double)); 49 for(i=0;i<n_interp;i++) predictions[i]=0; 46 50 47 for(i=0;i<n_interp;i++) predictions[i]=0; 48 observations->QuadtreeColoring(predictions,x_interp,y_interp,n_interp); 49 *ppredictions=predictions; 50 return 1; 51 /*Get output*/ 52 options->Get(&output,"output","quadtree"); 53 54 if(strcmp(output,"quadtree")==0){ 55 observations->QuadtreeColoring(predictions,x_interp,y_interp,n_interp); 56 *ppredictions=predictions; 57 return 1; 58 } 51 59 52 60 /*Loop over all interpolations*/ … … 56 64 57 65 /*Get list of observations for current point*/ 58 observations->ObservationList(&x,&y,&obs,&n_obs,x_interp[idx],y_interp[idx] );66 observations->ObservationList(&x,&y,&obs,&n_obs,x_interp[idx],y_interp[idx],range); 59 67 60 68 /*Allocate intermediary matrix and vectors*/ … … 105 113 delete variogram; 106 114 delete observations; 115 xfree((void**)&output); 107 116 *ppredictions=predictions; 108 117 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.