function mm_to_msm_test ( )

%*****************************************************************************80
%
%% mm_to_msm_test() tests mm_to_msm().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 February 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../mm_to_msm' );

  timestamp ( )
  fprintf ( 1, '\n' );
  fprintf ( 1, 'mm_to_msm_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test mm_to_msm().\n' );

  file_name = 'wathen_29_29_adg.txt';

  fprintf ( 1, '\n' );
  fprintf ( 1, '  We will read the file "%s".\n', file_name );

  [ A, rows, cols, entries, rep, field, symm ] = mm_to_msm ( file_name );
  
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix order is %d rows by %d columns\n', rows, cols );
  fprintf ( 1, '  Number of entries is %d\n', entries );
  fprintf ( 1, '  Matrix representation is "%s"\n', rep );
  fprintf ( 1, '  Matrix arithmetic field is "%s"\n', field );
  fprintf ( 1, '  Matrix symmetry type is "%s"\n', symm );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Whether A is full or sparse, we can manipulate it\n' );
  fprintf ( 1, '  now with MATLAB.  Here we get the eigenvalues.\n' );
  fprintf ( 1, '  For the Wathen matrix, these will all be positive.\n' );

  lambda = eig ( A );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Eigenvalues of the Wathen matrix:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : rows
    fprintf ( 1, '  %f\n', lambda(i) );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'mm_to_msm_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( )

  rmpath ( '../mm_to_msm' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

