The type of the geo-values property must be convertible to double.
typedef std::vector<geo_value2d> neighborhood;
int main()
{
location2d u1(2,3);
location2d u2(4,-7);
geo_value2d Z1(u1,0.21);
geo_value2d Z2(u2,0.09);
Neighborhood neighbors;
neighbors.push_back(Z1);
neighbors.push_back(Z2);
location2d u(0,0);
std::vector<double> weights;
double kvariance = kriging_weights(weights,
u, &neighbors,
gauss_covariance, OK_constraint);
double kmean = linear_combine(weights.begin(),weights.end(),
neighbors);
}
Replacing the last line by
std::vector<double>::iterator end_weights = weights.begin()+2;
double kmean = linear_combine(weights.begin(), end_weights,
neighbors);
would have led to the same value of kmean.