function solvable = lo_solvable ( L )

%*****************************************************************************80
%
%% lo_solvable() tests a Lights Out configuration for solvability.
%
%  Discussion:
%
%    A given 5x5 Lights Out configuration L is solvable if and only if
%    if is orthogonal to both the N1 and N2 solvability matrices.
%
%    Here orthogonal means orthogonal modulo 2.  You take the element-wise
%    dot product of the two matrices modulo 2.  If it is zero, then they
%    are orthogonal.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 November 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    logical L(5,5): the configuration to check.
%
%  Output:
%
%    logical solvable: true if the configuration is solvable.
%
  [ N1, N2 ] = lo_solvability_matrices ( );

  LN1_dot = lo_dot ( L, N1 );
  LN2_dot = lo_dot ( L, N2 );

  solvable = ( ( LN1_dot == 0 ) && ( LN2_dot == 0 ) );

  return
end

