disp('Running MATLAB script file k2dgt.m') ;
%
%    FOR DEVELOPMENT AND TESTING OF MATLAB FUNCTION k2dg,
%       K2DG, Kernel: 2 Dimensional Gaussian
%    General Purpose Curves a Data analysis

itest = 5 ;    %  1,2,3,4,5



format compact ;



if itest == 1 ;   
  disp('  Various bad parameter checks') ;

%  xg = ones(2,2) ;
  xg = 1:6 ;
%  yg = 1:6 ;
  yg = (1:6)' ;

%  h = 0 ;
  h = 1 ;
  k2dg(xg,yg,h) 


elseif itest == 2 ;
  disp('  More bad parameter checks') ;

  xg = 1:6 ;
  yg = (1:6)' ;
  h = 1 ;

%  id = 7 ;
  id = 12 ;
%  in = 0 ;
  in = 2 ;

  k2dg(xg,yg,h,id,in) 


elseif itest == 3 ;
  disp('  Look at kernel shapes') ;

  n = 20 ;
%  m = 40 ;
  m = 20 ;
  h = 6 ;

%  id = 0 ;
%  id = 1 ;
%  id = 2 ;
%  id = 11 ;
%  id = 12 ;
  id = 22 ;

  kernel = k2dg((1-n):(n-1),((1-m):(m-1))',h,id) ;

  figure(1) ;
  mesh(kernel) ;


elseif itest == 4 ;
  disp('  check regression normalization') ;

  n = 20 ;
  m = 20 ;
  h = 6 ;

  kernel = k2dg((1-n):(n-1),((1-m):(m-1))',h) ;

  disp(['  Check this is one: ' num2str(sum(sum(kernel)))]) ;


elseif itest == 5 ;
  disp('  check regression normalization') ;

  n = 20 ;
  m = 20 ;
  h = 6 ;
  in = 2 ;

  kernel = k2dg((1-n):(n-1),((1-m):(m-1))',h,0,in) ;

  disp(['  Check this is one: ' num2str(sum(sum(kernel)))]) ;


end ;

