function pariomino_variants_test01 ( )

%*****************************************************************************80
%
%% pariomino_variants_test01 tests pariomino_variants.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 May 2020
%
%  Author:
%
%    John Burkardt
%
  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pariomino_variants_test01\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  pariomino_variants() determines variants\n' );
  fprintf ( 1, '  of an array of pariominoes.\n' );
%
%  Define several pariominoes.
%
  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 pariominoes 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 copies.
%
  d(1:p_num) = 1;
%
%  Print the region.
%
  label = '  Region in which pariominoes must fit:';
  pariominoes_print ( mr, nr, 1, r, label );
%
%  Print the array of pariominoes.
%
  label = '  Array of pariominoes to be analyzed:';
  pariominoes_print ( mp, np, p_num, p, label );
%
%  Request all the variants.
%
  [ v_num, v, v_p ] = pariomino_variants ( mp, np, p_num, p, d );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The pariominoes have %d variants that fit the region\n', v_num );

  for k = 1 : v_num
    label = sprintf ( '  Variant %d of pariomino %d', k, v_p(k) );
    pc = pariomino_condense ( v(1:mp,1:np,k) );
    pariomino_print ( pc, label );
  end
 
  return
end
