Function dogleg

Given an m by n matrix A, an n by n nonsingular diagonal matrix D, an m-vector b, and a positive number delta, the problem is to determine the convex combination x of the Gauss-Newton and scaled gradient directions that minimizes (Ax-b) in the least squares sense, subject to the restriction that the Euclidean norm of Dx be at most delta.

void dogleg(Real) (
  size_t n,
  Real* r,
  size_t lr,
  Real* diag,
  Real* qtb,
  Real delta,
  Real* x,
  Real* wa1,
  Real* wa2
);

This function completes the solution of the problem if it is provided with the necessary information from the QR factorization of A. That is, if A=QR, where Q has orthogonal columns and R is an upper triangular matrix, then dogleg expects the full upper triangle of R and the first n components of (Q^T)b.

Parameters

NameDescription
n a positive integer variable set to the order of R.
r the upper triangular matrix R.
lr (not documented)
diag a vector of length n which must contain the diagonal elements of the matrix D.
qtb a vector of length n which must contain the first n elements of the vector (Q^T)b.
delta a positive variable which specifies an upper bound on the Euclidean norm of Dx.
x an output vector of length n which contains the desired convex combination of the Gauss-Newton direction and the scaled gradient direction.
wa1 work array of length n.
wa2 work array of length n.