% show soln
function clshow(k_in);

  global A C lnFinv finv k n result

  disp("showing result"); fflush(1);
 
  n=256; 
  k=exp(k_in);   % <=== SET 'k' HERE (e^k) !!!!

  result=zeros(n);
  finv = exp(lnFinv);
  
  for i=1:n
    kq= k*finv(i);
    % j1 is from going up; j2 from going down
    % nearest neighbour search rather than binary search (easier to implement)
    j1=  1; while ((kq>=finv(j1))&&(j1<256)) ; j1=j1+1; end
    j2=256; while ((kq<=finv(j2))&&(j2>  1)) ; j2=j2-1; end 
    j = (j1+j2)/2;
    %disp(sprintf('kq=% 15.10f   i=%03d,  j=%03d',kq,i,j));
    result(i,j)=255;
  end%for
  %imshow(result);
end

