function polyomino_multihedral_variants_test01 ( )

%*****************************************************************************80
%
%% polyomino_multihedral_variants_test01 tests POLYOMINO_MULTIHEDRAL_VARIANTS.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 May 2020
%
%  Author:
%
%    John Burkardt
%
  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'polyomino_multihedral_variants_test01\n' );
  fprintf ( 1, '  POLYOMINO_MULTIHEDRAL_VARIANTS determines variants\n' );
  fprintf ( 1, '  of an array of polyominoes.\n' );
%
%  Define several polyominoes.
%
  p1 = [ ...
    1, 1, 1, 1 ];
  [ mp1, np1 ] = size ( p1 );

  p2 = [ ...
    1, 1, 0; ...
    0, 1, 0; ...
    0, 1, 1 ]; 
  [ mp2, np2 ] = size ( p2 );

  p3 = [ ...
    1, 0, 0;
    1, 1, 1 ];
  [ mp3, np3 ] = size ( p3 );
%
%  Set the encompassing region.
%
  r = [ ...
    1, 1, 1, 1, 1;
    1, 1, 1, 1, 1;
    1, 1, 1, 1, 1 ];
  [ mr, nr ] = size ( r );
%
%  Pack the polyominoes into a single array.
%
  mp = mr;
  np = nr;
  p_num = 3;

  p = zeros ( mp, np, p_num );
 
  p(1:mp1,1:np1,1) = p1(1:mp1,1:np1);
  p(1:mp2,1:np2,2) = p2(1:mp2,1:np2);
  p(1:mp3,1:np3,3) = p3(1:mp3,1:np3);
%
%  Specify number of variants.
%
  d(1:p_num) = 1;
%
%  Print the region.
%
  label = '  Region in which polyominoes must fit:';
  polyominoes_print ( mr, nr, 1, r, label );
%
%  Print the array of polyominoes.
%
  label = '  Array of polyominoes to be analyzed:';
  polyominoes_print ( mp, np, p_num, p, label );
%
%  Request all the variants.
%
  [ v_num, v, v_p ] = polyomino_multihedral_variants ( mp, np, p_num, p, d );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The polyominoes have %d distinct variants\n', v_num );

  for k = 1 : v_num
    label = sprintf ( '  Variant %d of polyomino %d', k, v_p(k) );
    [ mpc, npc, pc ] = polyomino_condense ( mp, np, v(1:mp,1:np,k) );
    polyomino_print ( mpc, npc, v(1:mpc,1:npc,k), label );
  end
 
  return
end
