function polyomino_embed_list_test ( )

%*****************************************************************************80
%
%% polyomino_embed_list_test() tests polyomino_embed_list().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 May 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'polyomino_embed_list_test():\n' );
  fprintf ( 1, '  polyomino_embed_list() lists the offsets used\n' );
  fprintf ( 1, '  to embed a fixed polyomino in a region.\n' );

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

  polyomino_print ( r, '  The given region R:' );

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

  polyomino_print ( p, '  The given polyomino P:' );
%
%  Get the number of embeddings.
%
  number = polyomino_embed_number ( mr, nr, r, mp, np, p );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  As a fixed polyomino, P can be embedded in R in %d ways\n', number );
%
%  Get the list of embeddings.
%
  list = polyomino_embed_list ( mr, nr, r, mp, np, p, number );

  for k = 1 : number
    mk = list(k,1);
    nk = list(k,2);
    mq = mr;
    nq = nr;
    q = r;
    q(1+mk:mp+mk,1+nk:np+nk) = q(1+mk:mp+mk,1+nk:np+nk) + p(1:mp,1:np);
    fprintf ( 1, '\n' );
    fprintf ( 1, '  Embedding number %d:\n', k );
    fprintf ( 1, '\n' );
    for i = 1 : mq
      for j = 1 : nq
        fprintf ( 1, ' %d', q(i,j) );
      end
      fprintf ( 1, '\n' );
    end
  end

  return
end
