function rref_columns_test ( )

%*****************************************************************************80
%
%% rref_columns_test() tests rref_columns().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 December 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'rref_columns_test():\n' );
  fprintf ( 1, '  rref_columns() uses the reduced row echelon form (RREF)\n' );
  fprintf ( 1, '  of a matrix to find the linearly independent columns.\n' );

  m = 7;
  n = 4;

  A = [ ...
        1,  2, 3, 1; ...
        2,  4, 9, 3; ...
        3,  6, 0, 0; ...
        4,  8, 0, 2; ...
        5, 10, 6, 6; ...
        6, 12, 6, 3; ...
        7, 14, 2, 1 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix A:\n' );
  disp ( A );

  a_columns = rref_columns ( A );
  [ m, n2 ] = size ( a_columns );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of independent columns is %d\n', n2 );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Independent columns of A:\n' );
  disp ( a_columns );

  return
end

