global y;
global n;

global d;
global Nodes1;
global K;

gen_data;

global lambda;   %stable region: 10^{-11,10]
global sigma;
global gckl;
global gacv;

s = 1;
t = 30;


%s = 22;    %iteration for sigma
%t = 1;   %iteration for lambda


lambda = zeros(t,1);
sigma = zeros(s,1);
gckl = zeros(s*t,1);
gacv = zeros(s*t,1);

for j = 1:s
   %sigma(j,1) = 2^(0.5*j-8);
   sigma(j,1) = 2^(2.5);
   %generate K
   for a =1:n
      for b=1:n
         tmp = sum((Nodes1(a,:)-Nodes1(b,:)).^2);
         K(a,b)= exp(-tmp/(2*sigma(j,1)*sigma(j,1))); 
      end
   end
   for i = 1:t
  %display('*********mysigma*********');
  %sigma(j,1)
  lambda(i,1) = 2^(i*0.5-18);
  %lambda(i,1) = 2^(-7); 
  [gckl((j-1)*t+i,1), gacv((j-1)*t+i,1)] = solve(lambda(i,1),sigma(j,1)); 
  end
end


diary tmp2.5;
[log2(lambda) log2(gckl) log2(gacv)]
diary off;








