Overview | Group | Index | Concepts |
The routine CPXcopylp
copies data that define an LP
problem to a CPLEX problem object. The arguments to CPXcopylp
define an objective function, the constraint matrix, the righthand side,
and the bounds on the variables.
Calling CPXcopylp
destroys any existing data
associated with the problem object.
The routine CPXcopylp
does not copy names.
The more comprehensive routine
CPXcopylpwnames
can be used
in place of CPXcopylp
to copy linear programs with associated
names.
The arguments passed to CPXcopylp
define a linear program.
Since these arguments are copied into local arrays maintained by CPLEX, the
LP problem data passed via CPXcopylp
may be modified or freed
after the call to CPXcopylp
without affecting the state of
the CPLEX problem object.
objsense | = 1 | (CPX_MIN ) minimize |
objsense | = -1 | (CPX_MAX ) maximize |
sense[i] | = 'L' | <= constraint |
sense[i] | = 'E' | = constraint |
sense[i] | = 'G' | >= constraint |
sense[i] | = 'R' | ranged constraint |
The arrays
matbeg
,
matcnt
,
matind
, and
matval
are accessed as follows. Suppose that CPLEX wants to access
the entries in some column j
. These are assumed to be given by
the array entries:
matval[matbeg[j]],.., matval[matbeg[j]+matcnt[j]-1]
The corresponding row indices are:
matind[matbeg[j]],.., matind[matbeg[j]+matcnt[j]-1]
Entries in matind
are not required to be in row order.
Duplicate entries in matind
within a single column are not
allowed. The length of the arrays matbeg
and
matind
should be at least numcols
. The length
of arrays matind
and matval
should be at least
matbeg[numcols-1]+matcnt[numcols-1]
.
When you build or modify your model with this routine,
you can verify that the results are as you intended
by calling CPXcheckcopylp
during application development.
Example
status = CPXcopylp (env, lp, numcols, numrows, objsen, obj, rhs, sense, matbeg, matcnt, matind, matval, lb, ub, rngval);
See also the example lpex1.c
in the
ILOG CPLEX User's Manual and in the standard distribution.
env | A pointer to the CPLEX environment as returned by |
lp | A pointer to a CPLEX problem object as returned by |
numcols | An integer that indicates the number of columns in the constraint matrix, or equivalently, the number of variables in the problem object. |
numrows | An integer that indicates the number of rows in the constraint matrix, not including the objective function or bounds on the variables. |
objsense | An integer that indicates whether the problem is a minimization or maximization problem. |
objective | An array of length at least |
rhs | An array of length at least |
sense | An array of length at least |
matbeg | An array that with |
matcnt | An array that with |
matind | An array that with |
matval | An array that with |
lb | An array of length at least |
ub | An array of length at least |
rngval | An array of length at least |