function Ab = elim ( i, j )

%*****************************************************************************80
%
%% elim() uses Ab(j,j) to eliminate Ab(i,j).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 January 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer i, j, the row and column indices of the entry to eliminate.
%
%  Output:
%
%    real Ab(m,n+k), the augmented matrix has been modified.
%
  global Ab
  global k
  global m
  global n

  if ( i == j )
    fprintf ( 1, 'elim(): Ignoring this command\n' );
    fprintf ( 1, '  I and J must be distinct.\n' );
    return
  end

  if ( Ab(i,j) == 0.0 )
    return
  end

  s = - Ab(i,j) / Ab(j,j);
  Ab(i,:) = Ab(i,:) + Ab(j,:) * s;
  Ab(i,j) = 0.0;

  return
end

