Creating and Deleting Problems

This table contains methods and routines for handling the first and last steps in an optimization application: creating and populating the problem object and deleting the problem object. You can populate the problem object using the methods in this table or using the methods in the Problem Modification table and the File Reading table.

Note: Names of classes, methods, and symbolic constants in the .NET API correspond very closely to those in the Java API with these systematic exceptions:

Purpose

Java API

C++ API

C API

Creates a problem object

Create an IloCplex object

Create an IloModel object

CPXcreateprob

Creates a problem object and copies problem data from another object into the new object.

----

----

CPXcloneprob

Copies LP data into a CPLEX problem

IloCplex.add of IloLPMatrix and IloObjective

IloCplex::extract extracts the modeling objects to the optimizer. IloCplex inherits this method from IloAlgorithm documented in the Reference Manual of the C++ API.

CPXcopylp

Copies LP data, including variable names and constraint names, into a CPLEX problem

IloCplex.add of IloLPMatrix and IloObjective

IloCplex::extract extracts the modeling objects to the optimizer.

CPXcopylpwnames

Copies an objective name into a CPLEX problem

IloObjective.setName IloObjective derives from IloAddable and thus inherits this method.

IloObjective::setName IloObjective derives from IloExtractable and thus inherits this method.

CPXcopyobjname

Copies ctype for MIP problems into a CPLEX problem

Variable types are set when IloNumVar (also IloIntVar and IloSemiContVar) objects are created. Temporary changes can be achieved with IloConversion objects.

Variable types are set when IloNumVar (also IloIntVar, IloBoolVar, and IloSemiContVar) objects are created. Temporary changes can be achieved with IloConversion objects.

CPXcopyctype

Copies a separable QP Q matrix into a CPLEX problem

IloObjective.setExpr or IloCplex.addObjective

IloObjective::setExpr

CPXcopyqpsep

Copies a QP Q matrix with off-diagonal elements into a CPLEX problem

IloObjective.setExpr or IloCplex.addObjective

IloObjective::setExpr

CPXcopyquad

Copies a basis into a CPLEX problem

IloCplex.setBasisStatuses

IloCplex::setBasisStatuses

CPXcopybase

Copies a starting basis and/or starting solution into a CPLEX problem

IloCplex.setVectors

IloCplex::setVectors

CPXcopystart

Copies a MIP priority order into a CPLEX problem

IloCplex.setPriorities
IloCplex.setDirections

IloCplex::setPriorities
IloCplex::setDirections

CPXcopyorder

Copies MIP starting values into a CPLEX problem

IloCplex.setVectors

IloCplex::setVectors

CPXcopymipstart

Copies MIP Special Ordered Set information into a CPLEX problem

SOSs are created when objects of type IloSOS1 or IloSOS2 are created or use IloMPModeler.addSOS1 or IloMPModeler.addSOS2

SOSs are created when objects of type IloSOS1 or IloSOS2 are created.

CPXcopysos

Copies a network as an LP

----

----

CPXcopynettolp

Empties LP cache

----

----

CPXcompletelp

Deletes CPLEX problem and frees associated memory

IloCplex.clearModel; the model object still exists, but it is empty

IloCplex.end releases the CPLEX license.

IloCplex::clearModel

CPXfreeprob