- Timestamp:
- 05/25/12 15:23:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Kriging/GaussianVariogram.cpp
r12282 r12289 59 59 60 60 /*Variogram function*/ 61 /*FUNCTION GaussianVariogram::Covariance{{{1*/ 62 double GaussianVariogram::Covariance(double deltax,double deltay){ 63 /*The covariance can be deduced from the variogram from the following 64 * relationship: 65 * 2 gamma = C(x,x) + C(y,y) -2 C(x,y) 66 * so 67 * C(h) = sill - gamma */ 68 double h2,a,cova; 69 70 /*Calculate length square*/ 71 h2=pow(deltax,2.)+pow(deltay,2.); 72 73 /*return covariance*/ 74 a = 1./3.; 75 cova = (sill-nugget)*exp(-h2/(a*range*range)); 76 77 //if(h2<0.0000001) cova = sill; 78 79 return cova; 80 } 81 /*}}}*/ 61 82 /*FUNCTION GaussianVariogram::SemiVariogram{{{1*/ 62 83 double GaussianVariogram::SemiVariogram(double deltax,double deltay){ … … 70 91 a = 1./3.; 71 92 gamma = (sill-nugget)*(1.-exp(-h2/(a*range*range))) + nugget; 93 94 //if(h2>1000*1000) printf("gamma = %g h= %g\n",gamma,sqrt(h2)); 95 printf("h = %g gamma = %g\n",sqrt(h2),gamma); 72 96 return gamma; 73 97 }
Note:
See TracChangeset
for help on using the changeset viewer.