function initialized = initialized_memory ( i, initialized )

%*****************************************************************************80
%
%% INITIALIZED_MEMORY stores the INITIALIZED value.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    28 March 2013
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer I, the desired action.
%    -1, get a value.
%    0, initialize all values.
%    1, set a value.
%
%    Input/output, int INITIALIZED.  For I = -1, an output quantity, 
%    if I = +1, an input quantity, and if I = 0 the value is ignored.
%
  persistent initialized_save;

  if ( i < 0 )
    initialized = initialized_save;
  elseif ( i == 0 )
    initialized_save = 0;
    initialized = 0;
  elseif ( 0 < i )
    initialized_save = initialized;
  end

  return
end
