ILOG CPLEX .NET Reference Manual

Cplex Members

Cplex overview

Public Static Methods

Putenv Sets the ILOG_LICENSE_FILE environment variable used by CPLEX.
RegisterLicense Passes memory-based information to the ILOG License Manager.

Public Instance Constructors

Cplex Constructor This constructor creates an instance of Cplex with an empty active model.

Public Instance Properties

BestObjValue Gets a bound on the optimal solution value of the active problem in a MIP. When a model has been solved to optimality, this value matches the optimal solution value within the current MIP gap tolerance. If a MIP optimization is terminated before optimality has been proven, this value is computed for a minimization (maximization) problem as the minimum (maximum) objective function value of all remaining unexplored nodes.
Cutoff Gets the cutoff for the objective value when nodes are being solved during branch-and-cut search. This value is typically computed from the objective value of an incumbent solution and the optimality gap. In the case of a minimization problem, for example, if the objective value of a node exceeds the cutoff value, the node can be pruned without the need to solve the node to optimality.
IncumbentNode Gets the node number where the current incumbent was found.
Name (inherited from CplexModeler) 
NbarrierIterations Gets the number of barrier iterations from the last solve.
NbinVars Gets the number of binary (or Boolean) variables in the matrix representation of the active model. Note that the result is not necessarily equal to the number of Boolean variables in the active model, as some mapping of modeling objects may require the introduction of added matrix columns.
Ncliques Deprecated, no replacement.
Ncols Gets the number of columns in the matrix representation of the active model. Note that the result may be greater than the number of variables in the active model, since some modeling objects may require more than one matrix column.
Ncovers Deprecated, no replacement.
NcrossDExch Gets the number of dual exchange operations in the crossover of the last solve.
NcrossDPush Gets the number of dual push operations in the crossover of the last solve.
NcrossPExch Gets the number of primal exchange operations in the crossover of the last solve.
NcrossPPush Gets the number of primal push operations in the crossover of the last solve.
NdualSuperbasics Gets the number of dual superbasic variables in the basis.
NintVars Gets the number of integer variables in the matrix representation of the active model. Note that the result is not necessarily equal to the number of integer variables in the active model, as some mapping of modeling objects may require the introduction of added matrix columns.
Niterations Gets the number of iterations from the last solve.
Nnodes Gets the number of branch-and-cut nodes explored in solving the active model.
NnodesLeft Gets the number of unexplored nodes in the branch-and-cut tree.
NNZs Gets the number of nonzero elements in the matrix representation of the active model.
NphaseOneIterations Gets the number of phase I iterations from the last solve.
NprimalSuperbasics Gets the number of primal superbasic variables in the basis.
NQCs Gets the number of quadratic constraints in the active model. Note that the result may be different from the number of constraints in the active model, since linear constraints are counted separately.
Nrows Gets the number of rows in the matrix representation of the active model. Note that the result may be different from the number of constraints in the active model, since some modeling objects may require more than one matrix row and quadratic constraints are not accounted for as rows.
NsemiContVars Gets the number of semi-continuous variables in the matrix representation of the active model.
NsemiIntVars Gets the number of semi-integer variables in the matrix representation of the active model.
NsiftingIterations Gets the number of sifting iterations from the last solve.
NsiftingPhaseOneIterations Gets the number of sifting phase I iterations from the last solve.
NSOS1 Gets the number of SOSs of type 1 in the active model.
NSOS2 Gets the number of SOSs of type 2 in the active model.
NSOSs Gets the number of SOSs of both types, 1 and 2 in the active model.
ObjValue Gets the objective value of the current solution.
Ray Gets a linear expression representing an unbounded direction for the active model if it has been proven unbounded by one of the simplex methods. If a*x + b*y is the returned by this method, it represents an unbounded direction vector with an x coordinate of a and y coordinate of b.
SubAlgorithm Gets the type of the algorithm that was used to generate the solution of the last branch-and-cut node solved during a MIP solve terminated because of an error during mixed integer optimization.
Version Gets a string that indicates the version of CPLEX.

Public Instance Methods

Abs (inherited from CplexModeler)Overloaded. Returns an expression representing the absolute value of its argument, the expression indicated by expr.
Add (inherited from CplexModeler)Overloaded. Adds part of the array of objects to the invoking model, starting with the index start and continuing to the number of objects indicated by num.
AddCut Adds the constraint cut as a cut to the invoking Cplex object.
AddCutsOverloaded. Adds num constraints given in cut as cuts to the invoking Cplex object, starting with element cut[start].
AddEq (inherited from CplexModeler)Overloaded. See {
AddGe (inherited from CplexModeler)Overloaded. See {
AddLazyConstraint This is an advanced method.
AddLazyConstraintsOverloaded. This is an advanced method.
AddLe (inherited from CplexModeler)Overloaded. See {
AddLPMatrix (inherited from CplexModeler)Overloaded. See {
AddMaximize (inherited from CplexModeler)Overloaded. See {
AddMinimize (inherited from CplexModeler)Overloaded. See {
AddObjective (inherited from CplexModeler)Overloaded. See {
AddRange (inherited from CplexModeler)Overloaded. See {
AddSOS1 (inherited from CplexModeler)Overloaded. See {
AddSOS2 (inherited from CplexModeler)Overloaded. See {
AddToExpr (inherited from CplexModeler)Overloaded. See {
AddUserCut This is an advanced method.
AddUserCutsOverloaded. This is an advanced method.
And (inherited from CplexModeler)Overloaded. Groups together the constraints indicated by its arguments and assigns the string name to the group.
AndOverloaded. Creates and returns an and goal from two arguments.
Apply Returns a goal that applies the evaluator to the search tree defined by the goal.
BoolVar (inherited from CplexModeler)Overloaded. See {
BoolVarArray (inherited from CplexModeler)Overloaded. See {
Bound Creates and returns an object of type INumVarBound to represent the specified bound of the variable var.
BranchAsCplex Creates and returns a goal that branches the same way Cplex would in the absence of any goal at the current node.
Card (inherited from CplexModeler) 
Cardinality (inherited from CplexModeler) 
ClearCallbacks Removes all callbacks from the invoking Cplex object.
ClearCuts Deletes all cuts added by the user to the invoking Cplex object with the methods addCut and addCuts.
ClearLazyConstraints This is an advanced method.
ClearModel Removes all modeling objects from the active model.
ClearUserCuts This is an advanced method.
Column (inherited from CplexModeler)Overloaded. See {
ColumnArray (inherited from CplexModeler)Overloaded. See {
Constant (inherited from CplexModeler)Overloaded. See {
ConstraintGoalOverloaded. Creates and returns a constraint goal for the specified constraint cut.
Conversion (inherited from CplexModeler)Overloaded. See {
DelDirection Removes any existing branching direction assignments from the variable var.
DelDirectionsOverloaded. Removes any existing branching direction assignments from num consecutive variables in the array var, starting with the variable var[start].
Delete (inherited from CplexModeler)Overloaded. See {
DelPrioritiesOverloaded. Removes any existing branch priority assignment from num consecutive variables in the array var, starting with the variable var[start].
DelPriority Removes any existing branch priority assignment from variable var.
Diff (inherited from CplexModeler)Overloaded. See {
DualFarkas This is an advanced method.
EndOverloaded. Releases the Cplex license held by the invoking object, and all the memory allocated by it.
EndModel 
Eq (inherited from CplexModeler)Overloaded. See {
EqGoalOverloaded. Creates a constraint goal for the constraint lhs == expr.
EqIntersection (inherited from CplexModeler) 
EqMax (inherited from CplexModeler)Overloaded.  
EqMin (inherited from CplexModeler)Overloaded.  
EqSum (inherited from CplexModeler)Overloaded.  
Equals (inherited from Object) Determines whether the specified Object is equal to the current Object.
EqUnion (inherited from CplexModeler) 
ExportModel Writes the active model to the file indicated by filename.
FailGoal Creates and returns a goal that always fails.
FeasOptOverloaded. This method computes a minimum-cost relaxation in order to make the active model feasible by relaxing the bounds of the range constraints specified in the array rngs.
Ge (inherited from CplexModeler)Overloaded. See {
GeGoalOverloaded. Creates a constraint goal for the constraint lhs >= expr.
GetAlgorithm Returns the algorithm that was used to generate the current solution.
GetAXOverloaded. Queries row activity values for a set of range constraints.
GetBasisStatusOverloaded. Returns the basis status for the constraint con.
GetBasisStatusesOverloaded. Returns basis statuses for num consecutive constraints, starting from the index specified by start, in the array of constraints con.
GetBoundSAOverloaded. Computes and returns sensitivity analysis for the bounds of the num consecutive variables, starting from the index specified by start, in the array var.
GetClone 
GetConflictOverloaded. This method accesses a conflict (or a subset of a conflict) previously computed by the method refineConflict and returns the conflict status of num consecutive constraints in the array cts.
GetConversionEnumerator (inherited from CplexModeler) Returns an enumerator over all IConversion objects in the active model.
GetCplexStatus Returns the status of the Cplex algorithm.
GetCplexSubStatus Returns the Cplex.CplexStatus status of the last node problem solved.
GetDefaultOverloaded. Returns the default value of a string parameter.
GetDeleteMode Returns the current delete mode of the invoking Cplex object.
GetDirection Returns the branch direction for a variable.
GetDirectionsOverloaded. Returns branch directions for num consecutive variables, starting from the index specified by var[start].
GetDiverging This method returns the diverging variable or constraint, in a case where the primal simplex algorithm has determined the problem to be infeasible.
GetDual Returns the dual solution value for a constraint.
GetDualsOverloaded. Returns dual solution values for num consecutive range constraints, starting from the index specified by start.
GetEnumerator (inherited from CplexModeler) Returns an enumerator suitable for the invoking model.
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetInfeasibilitiesOverloaded. Returns infeasibility values for num consecutive constraints, starting from the index specified by start, from an array con of constraints.
GetInfeasibilityOverloaded. Returns the infeasibility value for a constraint.
GetIntSetValue 
GetLPMatrixEnumerator (inherited from CplexModeler) Returns an enumerator over all ILPMatrix objects in the active model.
GetMaxOverloaded. Returns the maximum allowed value for a double parameter.
GetMinOverloaded. Returns the minimum value allowed for a double parameter.
GetModel (inherited from CplexModeler) Returns the active model.
GetName (inherited from CplexModeler) Returns the name of the invoking model, if there is one.
GetNSOSs Returns the number of SOSs of both types, 1 and 2 in the active model.
GetObjective (inherited from CplexModeler) Returns the IObjective object of the active model, or null if no IObjective object is currently in the active model.
GetObjSAOverloaded. Computes and returns sensitivity analysis for objective coefficients for num consecutive variables, starting at the index specified by start.
GetParamOverloaded. Returns the current value of a string parameter.
GetParameterSet Returns a parameter set corresponding to the present parameter state.
GetPrioritiesOverloaded. Returns branch priorities for num consecutive variables, starting from the index specified by start.
GetPriority Returns the branch priority for a variable.
GetQuality Returns an instance of Cplex.Quality that contains the requested quality measure.
GetRangeEnumerator (inherited from CplexModeler) Returns an enumerator over all instances of IRange in the active model.
GetRangeSAOverloaded. Computes and returns sensitivity analysis for the constraints corresponding to the rows of the LP matrix matrix.
GetReducedCost Returns the reduced cost for a variable.
GetReducedCostsOverloaded. Returns reduced costs for num consecutive variables, starting from the index specified by start.
GetRHSSAOverloaded. Computes and returns sensitivity analysis for the righthand side (RHS) values of num constraints, corresponding to a range of rows of an LP matrix, starting from the index specified by start.
GetSlack Returns the slack value for a range constraint.
GetSlacksOverloaded. Returns slack values for num consecutive constraints, starting from the index specified by start, from an array rng.
GetSOS1Enumerator (inherited from CplexModeler) Returns an enumerator over all ISOS1 objects in the active model.
GetSOS2Enumerator (inherited from CplexModeler) Returns an enumerator over all ISOS2 objects in the active model.
GetStatus Returns the solution status of the active model.
GetType (inherited from Object) Gets the Type of the current instance.
GetValueOverloaded. Returns the value that expr takes for the current solution.
GetValuesOverloaded. Returns solution values for a set of variables.
GlobalCutGoalOverloaded. Creates and returns a global cut goal for the constraint cut.
IfThen (inherited from CplexModeler)Overloaded. Returns a constraint that if con1 is true, then con2 must also be true.
ImportModel Reads a model from the file indicated by name into the active model.
Intersect (inherited from CplexModeler) 
IntExpr (inherited from CplexModeler) See {
IntSet (inherited from CplexModeler)Overloaded. Creates and returns a set of integers populated by values, an array of integers.
IntSetVar (inherited from CplexModeler)Overloaded.  
IntSetVarArray (inherited from CplexModeler) 
IntVar (inherited from CplexModeler)Overloaded. See {
IntVarArray (inherited from CplexModeler)Overloaded. See {
IsDualFeasible Returns true if a dual feasible solution is available.
IsMIP Returns true if the active model is a MIP.
IsPrimalFeasible Returns true if a primal feasible solution is available.
IsQC Returns true if the active model has quadratic constraints.
IsQO Returns true if the active model has a quadratic objective function.
IsQP 
IsQuadratic 
Le (inherited from CplexModeler)Overloaded. See {
LeGoalOverloaded. Creates a constraint goal for the constraint lhs >= expr.
LimitSearch This function creates and returns a goal that limits the exploration of the search tree defined by goal, as specified by limit.
LinearIntExpr (inherited from CplexModeler)Overloaded. See {
LinearNumExpr (inherited from CplexModeler)Overloaded. See {
LowerBound Creates and returns an object of type INumVarBound to represent the lower bound of the variable var.
LPMatrix (inherited from CplexModeler)Overloaded. See {
MakeClone 
Max (inherited from CplexModeler)Overloaded. Returns an expression representing the maximum of its argument, the elements of an array.
Maximize (inherited from CplexModeler)Overloaded. See {
Member (inherited from CplexModeler) 
Min (inherited from CplexModeler)Overloaded. Returns an expression representing the minimum of its argument, the elements of an array.
Minimize (inherited from CplexModeler)Overloaded. See {
Negative (inherited from CplexModeler)Overloaded. See {
Neq (inherited from CplexModeler)Overloaded.  
Not (inherited from CplexModeler)Overloaded. Returns a constraint that is the logical negation of its argument.
NotMember (inherited from CplexModeler) 
NullIntersect (inherited from CplexModeler) 
NumExpr (inherited from CplexModeler) See {
NumVar (inherited from CplexModeler)Overloaded. See {
NumVarArray (inherited from CplexModeler)Overloaded. See {
Objective (inherited from CplexModeler)Overloaded. See {
Or (inherited from CplexModeler)Overloaded. Returns a constraint that at least one and possibly both of its arguments are true.
OrOverloaded. Creates and returns an or goal from two arguments.
Output 
PiecewiseLinear (inherited from CplexModeler)Overloaded. See {
Prod (inherited from CplexModeler)Overloaded. See {
QpIndefCertificate Returns a vector proving that the Q matrix of QP is not positive semi-definite.
Range (inherited from CplexModeler)Overloaded. See {
ReadBasis Reads a simplex basis from the BAS file indicated by name, and copies that basis into the invoking object.
ReadMIPStart Reads the SOL file denoted by name and copies the MIP start information into the invoking object.
ReadOrder Reads the ORD file indicated by name and copies the priority order information into the invoking CPLEX problem object.
ReadParam Reads parameters and their settings from the file indicated by name and applies them to the invoking object.
ReadSolution Reads a solution from the SOL file denoted by name and copies this information into the invoking object.
ReadVectors 
RefineConflictOverloaded. Refines a conflict consisting of a subset of constraints from an array.
Remove (inherited from CplexModeler)Overloaded. Removes part of the array of objects from the invoking model, starting with the index start and continuing to the number of objects indicated by num.
ScalProd (inherited from CplexModeler)Overloaded. Creates and returns a linear expression representing the scalar product of the given variables.
SemiContVar (inherited from CplexModeler)Overloaded. See {
SemiContVarArray (inherited from CplexModeler)Overloaded. See {
SetBasisStatusesOverloaded. Sets basis statuses for cnum consecutive variables, starting from the index specified by var[start], and rnum consecutive constraints, starting from the index specified by con[start].
SetDefaults Resets all parameters to their default values.
SetDeleteMode Sets the delete mode.
SetDirection Sets the branching direction for a variable.
SetDirectionsOverloaded. Sets branching directions for num consecutive variables, starting from the index specified by start.
SetLinearCoef (inherited from CplexModeler)Overloaded. See {
SetLinearCoefs (inherited from CplexModeler)Overloaded. See {
SetModel Sets model as the active model.
SetName (inherited from CplexModeler) Sets str as the name of the invoking model.
SetOut Sets the default output stream of the invoking Cplex object.
SetParamOverloaded. Sets a string parameter to value val.
SetParameterSet Sets the parameter state using a parameter set.
SetPrioritiesOverloaded. Sets branch priorities for num consecutive variables, starting from the index specified by start.
SetPriority Sets the branch priority for the variable var.
SetVectorsOverloaded. Specifies a partial starting point for the next invocation of the method solve.
SetWarning Sets the warning stream of the invoking Cplex object.
SolutionGoal Creates and returns a solution goal.
SolveOverloaded. Solves the active model.
SolveFixed Solves the fixed active model.
SOS1 (inherited from CplexModeler)Overloaded. See {
SOS2 (inherited from CplexModeler)Overloaded. See {
Square (inherited from CplexModeler)Overloaded. See {
Subset (inherited from CplexModeler)Overloaded.  
SubsetEq (inherited from CplexModeler)Overloaded.  
Sum (inherited from CplexModeler)Overloaded. See {
ToString (inherited from CplexModeler) 
UpperBound Creates and returns an object of type INumVarBound to represent the upper bound of variable var.
Use Installs a user-written callback.
VisitChildren 
Warning Returns the warning output stream of the invoking Cplex object.
WriteBasis Writes the current simplex basis to the file indicated by name.
WriteConflict Writes a conflict file with the indicated name.
WriteMIPStart Writes a starting solution for a MIP in SOL format to the file denoted by name.
WriteOrder Writes a priority order file with the indicated name.
WriteParam Writes the parameter name and its current setting into the file indicated by name for all the CPLEX parameters that are not currently set at their default.
WriteSolution Writes solution information from an optimization in SOL format to the file indicated by name.
WriteTextSolution 
WriteVectors 

Protected Instance Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

Cplex Class | ILOG.CPLEX Namespace