function polyomino_monohedral_example_domino_test ( )

%*****************************************************************************80
%
%% polyomino_monohedral_example_domino_test() tests polyomino_monohedral_example_domino().
%
%  Discussion:
%
%    The region R is the "mutilated checkerboard":
%
%    01111111
%    11111111
%    11111111
%    11111111
%    11111111
%    11111111
%    11111111
%    11111110
%
%    To be covered by 31 dominos:
%
%      11
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 May 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'polyomino_monohedral_example_domino_test():\n' );
  fprintf ( 1, '  polyomino_monohedral_example_domino() sets up\n' );
  fprintf ( 1, '  the domino polyomino tiling example.\n' );
%
%  Define R.
%
  shape_r = [ ...
    0, 1, 1, 1, 1, 1, 1, 1;
    1, 1, 1, 1, 1, 1, 1, 1;
    1, 1, 1, 1, 1, 1, 1, 1;
    1, 1, 1, 1, 1, 1, 1, 1;
    1, 1, 1, 1, 1, 1, 1, 1;
    1, 1, 1, 1, 1, 1, 1, 1;
    1, 1, 1, 1, 1, 1, 1, 1;
    1, 1, 1, 1, 1, 1, 1, 0 ];

  [ m_r, n_r ] = size ( shape_r );
  polyomino_print ( shape_r, '  Region R:' );
%
%  Define P.
%
  shape_p = [ ...
    1, 1 ];

  [ m_p, n_p ] = size ( shape_p );
  polyomino_print ( shape_p, '  Polyomino P:' );
%
%  Get the system matrix and right hand side.
%
%  Construct the linear system implicitly, from R and P.
%
  [ a, b ] = polyomino_monohedral_matrix ( shape_r, shape_p )
  [ m, n ] = size ( a );
%
%  Print the linear system.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  System matrix A and right hand side B:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : m
    fprintf ( 1, '  ' );
    for j = 1 : n
      fprintf ( 1, '%2d', a(i,j) );
    end
    fprintf ( 1, '  %2d\n', b(i) );
  end
%
%  Write the linear system to an LP file.
%
  filename = 'domino.lp';
  label = '\ LP file for the domino example, created by polyomino_lp_write().';

  polyomino_lp_write ( filename, label, m, n, a, b );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Wrote the LP file "%s"\n', filename );

  return
end
