function einsum_test ( )

%*****************************************************************************80
%
%% einsum_test() tests Einstein summation implemented by einsum().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    09 August 2026
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../einsum' );

  timestamp ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'einsum_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  einsum() carries out Einstein summation.\n' );

  matrix_column_sum_test ( );
  if ( true )
    fprintf ( 1, '  matrix_diagonal_test() fails for Octave einsum()!\n' );
  else
    matrix_diagonal_test ( );
  end
  matrix_matrix_multiplication_test ( );
  matrix_matrix_multiplication_hadamard_test ( );
  matrix_row_sum_test ( );
  if ( true )
    fprintf ( 1, '  matrix_trace_test() fails for Octave einsum()!\n' );
  else
    matrix_trace_test ( );
  end
  matrix_transpose_test ( );
  if ( true )
    fprintf ( 1, '  matrix_vector_multiplication_test() fails for Octave einsum()!\n' );
  else
    matrix_vector_multiplication_test ( );
  end
  if ( true )
    fprintf ( 1, '  vector_inner_product_test() fails for Octave einsum()!\n' );
  else
    vector_inner_product_test ( );
  end
  if ( true )
    fprintf ( 1, '  vector_norm_test() fails for Octave einsum()!\n' );
  else
    vector_norm_test ( );
  end
  if ( true )
    fprintf ( 1, '  vector_outer_product_test() fails for Octave einsum()!\n' );
  else
    vector_outer_product_test ( );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'einsum_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../einsum' );

  return
end
function timestamp ( )

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

  return
end

