Last active
October 18, 2021 10:39
-
-
Save MariaLavrovskaya/300afe947bcc33af2c9ee4c52fe0d8fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Backtracking line search until constraints are met. We decompose deltaY | |
deltaX = deltaY(1:n); | |
deltaL = deltaY(n+1:n+m); | |
deltaN = deltaY(n+m+1:end); %delta nu | |
s_max = 1; | |
s = s_max; | |
nIterBT = 0; | |
stopCondBackTrack = false; | |
while(~stopCondBackTrack && nIterBT < opts.maxIter) | |
%check if constrints are satisfied | |
if ((max(ineqConstraint.f(x_k + s*deltaX)) < 0) && (norm(res(t, x_k + s*deltaX, lambda_k + s*deltaL, nu_k + s*deltaN)) <= (1 - opts.alpha*s)*norm(res_k))) | |
stopCondBackTrack = true; | |
else | |
s = opts.beta*s; | |
nIterBT = nIterBT + 1; | |
end | |
end | |
% Updating our points | |
x_k = x_k + s*deltaX; | |
lambda_k = lambda_k + s*deltaL; | |
nu_k = nu_k + s*deltaN; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment