function variomino_embed_list_test ( )

%*****************************************************************************80
%
%% variomino_embed_list_test() tests variomino_embed_list().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%   19 April 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'variomino_embed_list_test():\n' );
  fprintf ( 1, '  variomino_embed_list() lists the offsets used\n' );
  fprintf ( 1, '  to embed a fixed variomino in a region.\n' );

  mr = 4;
  nr = 4;
  r = [ ...
     0,  2,  3,  1; 
     3,  1,  0,  3;
     2,  3,  1,  2; 
     1,  0,  3,  1 ];

  variomino_print ( r, '  region R:' );

  mp = 2;
  np = 3;
  p = [ ...
     2, 3, 1;
     1, 0, 0];

  variomino_print ( p, '  variomino P:' );
%
%  Get the number of embeddings.
%
  number = variomino_embed_number ( r, p );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  P can be embedded in R in %d ways\n', number );
%
%  Get the list of embeddings.
%
  list = variomino_embed_list ( r, p, number );

  for k = 1 : number
    mk = list(k,1);
    nk = list(k,2);
    mq = mr;
    nq = nr;
    q = r;
    for j = 1 : np
      for i = 1 : mp
        if ( p(i,j) ~= 0 )
          q(mk+i,nk+j) = Inf;
        end
      end
    end

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Embedding number %d:\n', k );
    fprintf ( 1, '\n' );

    for i = 1 : mq
      fprintf ( 1, '  ' );
      for j = 1 : nq
        if ( q(i,j) == Inf )
          fprintf ( 1, '*' );
        else
          fprintf ( 1, '%d', q(i,j) ); 
        end
      end
      fprintf ( 1, '\n' );
    end
  end

  return
end
