function polyomino_periodicity_apply_test ( )

%*****************************************************************************80
%
%% polyomino_periodicity_apply_test() tests polyomino_periodicity_apply().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 December 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'polyomino_periodicity_apply_test():\n' );
  fprintf ( 1, '  polyomino_periodicity_apply() applies periodicity to a\n' );
  fprintf ( 1, '  polyomino P with respect to a region R.\n' );
%
%  Set the region R.
%
  r = [ ...
    1, 1, 1; ...
    1, 1, 1; ...
    1, 1, 1; ...
    1, 1, 1];

  [ r_m, r_n ] = size ( r );
  label = '  Region R to be tiled:';
  polyomino_print ( r, label );
%
%  Set the polyomino P.
%
  p = [ ...
    0, 0, 0, 0, 0; ...
    0, 0, 0, 0, 0; ...
    0, 0, 1, 0, 0; ...
    0, 1, 1, 1, 0; ...
    0, 0, 1, 0, 0];

  [ p_m, p_n ] = size ( p );
  label = '  Polyomino P:';
  polyomino_print ( p, label );

  d = ( 5 );
%
%  Get T.
%
  t = polyomino_periodicity_apply ( r_m, r_n, r, p_m, p_n, p );
%
%  Print T.
%
  [ t_m, t_n ] = size ( t );
  label = '  Periodicized polyomino T:';
  polyomino_print ( t, label );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'polyomino_periodicity_apply_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

