function variomino_variants_test02 ( )

%*****************************************************************************80
%
%% variomino_variants_test02() tests variomino_variants().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 April 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'variomino_variants_test02():\n' );
  fprintf ( 1, '  variomino_variants() determines variants\n' );
  fprintf ( 1, '  of an array of variominoes.\n' );
%
%  Define several variominoes.
%
  p1 = [ ...
    1 ];
  [ mp1, np1 ] = size ( p1 );

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

  p3 = [ ...
     0,  0,  2;
     2,  3,  1 ];
  [ mp3, np3 ] = size ( p3 );
%
%  Set the encompassing region.
%
  r = [ ...
     2,  3,  1,  2;
     1,  2,  3,  1 ];
  [ mr, nr ] = size ( r );
%
%  Pack the variominoes 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 the number of duplicates.
%
  d(1:p_num) = 1;
%
%  Print the region.
%
  label = '  Region in which variominoes must fit:';
  variomino_print ( r, label );
%
%  Print the array of variominoes.
%
  label = '  Array of variominoes to be analyzed:';
  variominoes_print ( mp, np, p_num, p, label );
%
%  Request all the variants.
%
  [ v_num, v, v_p ] = variomino_variants ( mp, np, p_num, p, d );

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

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