Creating and deleting problems

These methods and routines handle the first and last steps in an optimization application: creating and populating the problem object and deleting the problem object.

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 C#.NET API correspond very closely to those in the Java API with these systematic exceptions:

  • In the Java API, the names of classes begin with the prefix Ilo, whereas in C#.NET they do not.

  • In the Java API, the names of methods conventionally begin with a lowercase letter, for example, addCols, whereas in the C#.NET API, the names of methods conventionally begin with an uppercase (that is, capital) letter, for example, AddCols according to Microsoft practice.

Purpose Java API C++ API C API
Creates a problem object Create an IloCplex object Create an IloModel object CPXXcreateprob and CPXcreateprob
Creates a problem object and copies problem data from another object into the new object; that is, clones a model. ---- Create an IloModel object and call IloModel::add with the model to be cloned as an argument. CPXXcloneprob and 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. CPXXcopylp and 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. CPXXcopylpwnames and 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. CPXXcopyobjname and 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. CPXXcopyctype and CPXcopyctype
Copies a separable QP Q matrix into a CPLEX problem IloObjective. setExpr or IloCplex. addObjective IloObjective:: setExpr CPXXcopyqpsep and CPXcopyqpsep
Copies a QP Q matrix with off-diagonal elements into a CPLEX problem IloObjective. setExpr or IloCplex. addObjective IloObjective:: setExpr CPXXcopyquad and CPXcopyquad
Copies a basis into a CPLEX problem IloCplex.setBasisStatuses(ilog.concert.IloNumVar[], ilog.cplex.IloCplex.BasisStatus[], ilog.concert.IloRange[], ilog.cplex.IloCplex.BasisStatus[]) IloCplex:: setBasisStatuses CPXXcopybase and CPXcopybase
Copies a starting basis and/or starting solution into a CPLEX problem IloCplex.setVectors(double[], double[], ilog.concert.IloNumVar[], double[], double[], ilog.concert.IloRange[]) ---- CPXXcopystart and CPXcopystart
Copies a MIP priority order into a CPLEX problem

IloCplex.setPriorities(ilog.concert.IloNumVar[], int[])

IloCplex.setDirections(ilog.concert.IloNumVar[], ilog.cplex.IloCplex.BranchDirection[])

IloCplex:: setPriorities

IloCplex:: setDirections

CPXXcopyorder and CPXcopyorder
Copies MIP starting values into a CPLEX problem IloCplex.setVectors(double[], double[], ilog.concert.IloNumVar[], double[], double[], ilog.concert.IloRange[]) ---- CPXXdelmipstarts and CPXdelmipstarts

followed by

CPXXaddmipstarts and CPXaddmipstarts
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(ilog.concert.IloNumVar[], double[])

or

IloMPModeler.addSOS2(ilog.concert.IloNumVar[], double[])

SOSs are created when objects of type IloSOS1 or IloSOS2 are created. CPXXcopysos and CPXcopysos
Copies a network as an LP ---- ---- CPXXcopynettolp and CPXcopynettolp
Empties LP cache ---- ---- CPXXcompletelp and CPXcompletelp
Deletes CPLEX problem and frees associated memory IloCplex. clearModel the model object still exists, but it is empty. IloCplex. end releases CPLEX. IloCplex:: clearModel CPXXfreeprob and CPXfreeprob