In the next section, we provide a brief tutorial on matrix initialization.
Matrix A(10,12); Real a[] = {11,12,....,61,62,63,.....,101,102,...,1012}; A << a;
Or, for small matrices you can enter the values as follows.
Matrix A(3,2); A << 11 << 12 << 21 << 22 << 31 << 32;
Now, we show the necessary steps for creation of linear equations and inequalities.
The LinearEquation constructor
LinearEquation(const Matrix& A, const ColumnVector& rhs);
The corresponding constructor is
LinearInequality(const Matrix& A, const ColumnVector& rhs);
To define upper bounds on the constraints, such as
use the following constructor:
LinearInequality(const Matrix& A, const ColumnVector& rhs, const bool rowFlag);
To create lower and upper bounds on the constraints, use
LinearInequality(const Matrix& A, const ColumnVector& lower, const ColumnVector& upper);
OPT++ does not support sparse constraints. Therefore, a bound must be given for each constraint even if only a subset of the constraint have finite bounds. An infinite lower bound is specified by
Similarly, an infinite upper bound is specified by
Next Section: Constructing nonlinear constraints | Back to Main Page
Last revised July 13, 2006