function initialized = initialized_memory ( i, initialized )

%*****************************************************************************80
%
%% initialized_memory() stores the INITIALIZED value.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 March 2013
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer I, the desired action.
%    -1, get a value.
%    0, initialize all values.
%    1, set a value.
%
%    integer INITIALIZED, if I = 1, the new INITIALIZED value.
%
%  Output:
%
%    integer INITIALIZED.  For I = 0 or -1, the initialized or current
%    INITIALIZED value.
%
  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
