Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions extras/@optimizer/subsref.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@
return
end

if self.model.options.warmstart
if nargout < 5
warning('If you intend to use initial guesses, you must use a fifth output as [sol,problem,~,~,P] = P(p)');
end
end

% This is not really supported yet...
if isa(subs.subs{1},'sdpvar')
varargout{1} = yalmip('definemulti','optimizer_operator',subs(1).subs{1},self,self.dimout);
Expand Down Expand Up @@ -230,6 +224,8 @@
nBlocks = 1;
end

initialGuessWarningIssued = false;

for i = 1:nBlocks

if ~isempty(self.diminOrig)
Expand Down Expand Up @@ -296,6 +292,11 @@
varargout{1} = self;
return
else
if self.model.options.warmstart && ( nargout < 5 ) && ~initialGuessWarningIssued
warning('If you intend to use initial guesses, you must use a fifth output as [sol,problem,~,~,P] = P(p)');
initialGuessWarningIssued = true;
end

% Standard case where we eliminate all variables left
self.instatiatedvalues(ismember(self.orginal_usedvariables,self.model.used_variables(self.model.parameterIndex))) = thisData(:);
[self.model,keptvariablesIndex] = eliminatevariables(self.model,self.model.parameterIndex,thisData(:),self.model.parameterIndex);
Expand Down