function optionsValidate(options, SolverName, SupportedAlgorithms)
%OPTIONSVALIDATE Ensure that the correct options are being passed.

%   Copyright 2020-2023 The MathWorks, Inc.

% Basic error checking on "options"
if ~isscalar(options)
    error(message('optimlib:warmstart:InvalidOptionsSize'));
elseif ~any(strcmpi(options.Algorithm, SupportedAlgorithms))
    error(message('optimlib:warmstart:UnsupportedAlgorithm', SolverName, options.Algorithm, SupportedAlgorithms));
end

end