# dtrnlsp_init

Initializes the solver of nonlinear least squares problem.

## Syntax

Fortran:

res = dtrnlsp_init(handle, n, m, x, eps, iter1, iter2, rs)

C:

res = dtrnlsp_init(&handle, &n, &m, x, eps, &iter1, &iter2, &rs);

## Description

The routine initializes the solver. After initialization all subsequent invocations of the dtrnlsp_solve routine should use the values of the handle returned by dtrnlsp_init.

The eps array contains the stopping tests:

`eps(1): Δk < eps(1)`

`eps(2): ||F(x)|| < eps(2)`

`eps(3): ||A(x)ij|| < eps(3)`

`eps(4): ||s|| < eps(4)`

`eps(5): ||F(x)||- ||F(x) - A(x)s|| < eps(5)`

`eps(6)`: the trial step precision. If `eps(6)` = 0, then `eps(6)` = 1.d-10,

where A is the Jacobi matrix, `Δk` is the trust region area, `F(x)` is the value of the functional, `s` is the trial step.

## Input Parameters

n

  INTEGER. Length of X.

m

  INTEGER. Length of F(x).

x

  DOUBLE PRECISION. Array of size n. Initial guess.

eps

  DOUBLE PRECISION. Array of size 6; contains stopping tests. See the values in Description.

iter1

  INTEGER. Specifies the maximum number of iterations.

iter2

  INTEGER. Specifies the maximum number of iterations of trial-step calculation.

rs

  DOUBLE PRECISION. Positive input variable used in determining the initial step bound. In most cases the factor should lie within the interval (0.1, 100.0). The generally recommended value is 100.

## Output Parameters

handle

  Data object of the _TRNSP_HANDLE_t type in C/C++ and INTEGER*8 in FORTRAN.

res

  INTEGER. Informs about the task completion.

  res = TR_SUCCESS means the routine completed the task normally.

  res = TR_INVALID_OPTION means an error in the input parameters.

  res = TR_OUT_OF_MEMORY means a memory error.

Parent topic: Nonlinear Least Squares Problem without Constraints