# Bound-constrained minimization

In this section, we describe the framework for a bound-constrained minimization problem.

## Creating a bound-constrained nonlinear problem

Once you have mastered bound-constrained objects and setting up the objective function, it is a simple 2-step process to build a bound-constrained nonlinear problem.

Let's consider the two-dimensional Rosenbrock problem with bounds on the variables:

minimize

subject to

Step 1: Build your bound constraint.

```   int ndim =  2;
ColumnVector lower(ndim), upper(ndim);
lower    = -2.0; upper    =  2.0;

Constraint bc = new BoundConstraint(ndim, lower, upper);
```

Step 2: Create a constrained NLF1 object.

```   NLF1 rosen_problem(n,rosen,init_rosen,&bc);
```

## Specifying the optimization method

OPT++ contains no less than six solvers for bound-constrained optimization problems. To name a few, there are implementations of Newton's method, barrier Newton's method, interior-point methods, and direct search algorithms. We provide examples of solving the bound-constrained Rosenbrock problem with an active set strategy and a nonlinear interior-point method.

Last revised July 13, 2006