28 const Array& oldGradient) {
41 diffGradient =
lineSearch_->lastGradient() - oldGradient;
44 diffGradientWithHessianApplied[i] +=
inverseHessian_[i][j] * diffGradient[j];
49 fac = fae = sumdg = sumxi = 0.;
52 fac += diffGradient[i] *
lineSearch_->searchDirection()[i];
53 fae += diffGradient[i] * diffGradientWithHessianApplied[i];
54 sumdg += std::pow(diffGradient[i], 2.);
55 sumxi += std::pow(
lineSearch_->searchDirection()[i], 2.);
58 if (fac > std::sqrt(1e-8 * sumdg * sumxi))
64 diffGradient[i] = fac *
lineSearch_->searchDirection()[i] - fad * diffGradientWithHessianApplied[i];
70 inverseHessian_[i][j] -= fad * diffGradientWithHessianApplied[i] * diffGradientWithHessianApplied[j];
Broyden-Fletcher-Goldfarb-Shanno optimization method.
1-D array used in linear algebra.
Size size() const
dimension of the array
Matrix inverseHessian_
inverse of hessian matrix
Array getUpdatedDirection(const Problem &P, Real gold2, const Array &oldGradient) override
computes the new search direction
ext::shared_ptr< LineSearch > lineSearch_
line search
Matrix used in linear algebra.
Constrained optimization problem.
const Array & currentValue() const
current value of the local minimum
std::size_t Size
size of a container
Line search abstract class.
Abstract optimization problem class.