function A_COLUMNS = rref_columns ( A )

%*****************************************************************************80
%
%% rref_columns() uses reduced row echelon form (RREF) for column independence.
%
%  Discussion:
%
%    The RREF process will identify columns that are linear combinations of
%    previous columns.
%
%    This function will return a matrix containing only the linearly
%    independent columns.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 December 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A(M,N), the matrix to be analyzed.
%
%  Output:
%
%    real A_COLUMNS(M,N2), a matrix whose N2 columns are the linearly
%    independent columns of A.
%
  [ a_ref, a_cols ] = rref_compute ( A );

  A_COLUMNS = A(:,a_cols);

  return
end

