function cc= gckl_est(v)

%v is n-by-1 vector, actually v is "flambda"


global Nodes1;
global d;

cc = 0;
[n,m] = size (Nodes1);

b1 = sqrt(8/pi - d^2)/2 - d/2;
b2 = b1 + d;

if m==2, 
  for i=1:n
    if v(i,1) >= 1 - (1e-16),
       if   Nodes1(i,2)^2 + Nodes1(i,1)^2  >=  b2^2, 
            cc = cc + (1+v(i,1))/20;
       elseif   Nodes1(i,2)^2 + Nodes1(i,1)^2  <=  b1^2,
            cc = cc + (1+v(i,1))* 19/20;
       else cc = cc + (1+v(i,1))/2;
       end

    elseif  v(i,1) <= -1 + (1e-16),
       if   Nodes1(i,2)^2 + Nodes1(i,1)^2  >=  b2^2, 
            cc = cc + (1-v(i,1))*19/20;
       elseif  Nodes1(i,2)^2 + Nodes1(i,1)^2  <=  b1^2
            cc = cc + (1-v(i,1))/20;
       else cc = cc + (1-v(i,1))/2;
       end

    else
       if   Nodes1(i,2)^2 + Nodes1(i,1)^2  >=  b2^2, 
            cc = cc + 1 - v(i,1)*9/10;
       elseif  Nodes1(i,2)^2 + Nodes1(i,1)^2  <=  b1^2,
            cc = cc + 1 + v(i,1)*9/10;
       else cc = cc + 1;
       end 
    end
  end
end
cc = cc/n;




