Skip to main content
FRAMES NO FRAMES

Class IloOplCplexBasis

Definition file: ilopl/ilooplmodel.h
Map of IloOplCplexBasisIloOplCplexBasisIloOplCplexBasis
Utility for CPLEX warm start of LP problems.

An instance of this class can be used to save basis information for one instance of IloCplex and restore it on other instances of IloCplex.

See Also:

Method Summary
public voidattach(IloNumVarMap vars, IloIntMap statuses)
public voidend()
public IloBoolgetBasis(IloCplex cplex)
public IloIntgetNcols() const
public IloIntgetNrows() const
public IloIntgetStatus() const
public IloOplCplexBasis(IloEnv env)
public IloBoolsetBasis(IloCplex cplex)
Method Detail

IloOplCplexBasis

public IloOplCplexBasis(IloEnv env)

Constructor.

Parameters:

env
The environment to allocate memory from.

attach

public void attach(IloNumVarMap vars, IloIntMap statuses)

Attach a variable map vars to a value map statuses. After some attachments have been done, only the elements with attachments are taken into account to get/set basis.

Parameters:

vars
The variable map to be attached.
statuses
The value map.

end

public void end()

Clears the memory used by this object


getBasis

public IloBool getBasis(IloCplex cplex)

Saves basis information for a CPLEX instance.

Parameters:

cplex
Saves the basis currently available on the given CPLEX instance.

Returns:

IloTrue if the basis was successfully saved.

getNcols

public IloInt getNcols() const

Returns the number of columns in the currently saved basis.

Returns:

An integer to indicate the number of columns in the currently saved basis.

getNrows

public IloInt getNrows() const

Returns the number of rows in the currently saved basis.

Returns:

An integer to indicate the number of rows in the currently saved basis.

getStatus

public IloInt getStatus() const

Returns the CPLEX status of the last invocation of CPLEX API.

Returns:

An integer to indicate the status of the CPLEX instance.

setBasis

public IloBool setBasis(IloCplex cplex)

Restores basis information for a CPLEX instance.

Note
This utility can restore bases only if the problem of the given CPLEX instance has exactly the number of rows and columns as the problem it was taken from.

Parameters:

cplex
Restores this basis on the given CPLEX instance.

Returns:

IloTrue if the basis was successfully restored.