This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
OM/Claudio_Maggioni_midterm/cauchy.m
2021-05-03 16:32:30 +02:00

12 lines
210 B
Matlab

function pk = cauchy(B, g, deltak)
gbg = (g' * B * g);
if gbg <= 0
tau = 1;
else
tau = min(norm(g, 2)^3 / (deltak * gbg), 1);
end
pk = -tau * deltak / norm(g, 2) * g;
end