Contents | Previous | Next | Subchapters |

Syntax |
`linlsqb(` A`, ` r`, ` eps`, ` xini`, ` xlow`, ` xup`) ` A`, ` r`, ` eps`, ` xini`, ` xlow`, ` xup`, ` active`)` |

See Also | linlsq , dnlsqb |

Returns a vector that solves the problem

minimize |*A* *x* - *r*|^2 with respect to *x*

such that *xlow*(*i*) __<__ *x*(*i*) __<__ *xup*(*i*)

where the matrix

If more than one solution exists,
the solution of minimum norm is returned:
the solution that minimizes `|`*x*|

over the set of solutions.

If the argument *active*(*i*)

is -1,
the constraint *xlow*(*i*) __<__ *x*(*i*)

is active.
If the output value of *active*(*i*)

is +1,
the constraint *x*(*i*) __<__ *xup*(*i*)

is active.
If neither of these constraints are active,
the output value of *active*(*i*)

is 0.
The following example solves the problem

minimize (*x*(1) - 4)^2 + (10 * *x*(2) - 30)^2 + (100 * *x*(3) - 200)^2

subject to -3 __<__ *x*(1) __<__ +3

-2 __<__ *x*(2) __<__ +2

-1 __<__ *x*(3) __<__ +1

The solution to this problem is *x*

equals to the
transpose of (3, 2, 1).
If you enter
```
```

A = diag([1., 10., 100.])

r = {4., 30., 200.}

eps = 1e-7

xini = {0., 0., 0.}

xlow = {-3., -2., -1.}

xup = {3., 2., 1.}

linlsqb(A, r, eps, xini, xlow, xup)

O-Matrix will respond
```
```

{

3

2

1

}

Every element of the upper limit