CPXcreateprob


Description

The routine CPXcreateprob() creates a CPLEX problem object in the CPLEX environment. The arguments to CPXcreateprob() define an LP problem name. The problem that is created is an LP minimization problem with zero constraints, zero variables, and an empty constraint matrix. The CPLEX problem object exists until the routine CPXfreeprob() is called.

To define the constraints, variables, and nonzero entries of the constraint matrix, any of the CPLEX LP problem modification routines may be used. In addition, any of the routines beginning with the prefix CPXcopy may be used to copy data into the CPLEX problem object. New constraints or new variables can be created with the routines CPXnewrows() or CPXnewcols(), respectively.

Return Value

If successful, CPXcreateprob() returns a pointer that can be passed to other CPLEX routines to identify the problem object that is created. If not successful, a NULL pointer is returned, and an error status is returned in the variable *status_p. If the routine is successful, *status_p is 0.

Synopsis

  CPXLPptr CPXcreateprob (CPXCENVptr env,
                          int *status_p,
                          const char *probname);

Arguments

CPXCENVptr env

The pointer to the CPLEX environment as returned by CPXopenCPLEX().

int *status_p

A pointer to an integer used to return any error code produced by this routine.

const char *probname

A character string that specifies the name of the problem being created.

Example

  lp = CPXcreateprob (env, &status, "myprob");

See Also

All example programs (except those pertaining to networks) in the CPLEX User's Manual.

Previous Page: CPXcopystart Return to Top Next Page: CPXdelchannel