Skip to main content
FRAMES NO FRAMES

Class IloOplRelaxationIterator

Definition file: ilopl/ilooplmodel.h
Map of IloOplRelaxationIteratorIloOplRelaxationIteratorIloOplRelaxationIterator
Utility for relaxing constraints.

Use this class with an infeasible model. It can be used to report relaxations needed to obtain a feasible problem.

Method Summary
public voidattach(IloConstraint ct, IloNum pref)
public voidattach(IloConstraintMap cts, IloNumMap prefs)
public voidend()
public voidfirst()
public IloConstraintgetConstraint() const
public IloNumgetLB() const
public IloNumgetRelaxedLB() const
public IloNumgetRelaxedUB() const
public IloNumgetUB() const
public IloBoolhasNext()
public IloOplRelaxationIterator(IloOplModel model)
public voidnext()
public IloIntprintRelaxation(std::ostream & os)
Method Detail

IloOplRelaxationIterator

public IloOplRelaxationIterator(IloOplModel model)

Creates the default relaxation iterator

Note
The default relaxation iterator is available for CPLEX models only.

See Also:


attach

public void attach(IloConstraint ct, IloNum pref)

Attach a constraint ct to a value pref (for preference). After some attachments have been done, only the constraints with attached preferences are taken into account for relaxation.

Parameters:

ct
An IloConstraint object for the constraint to attach a preference to.
pref
The preference value.

attach

public void attach(IloConstraintMap cts, IloNumMap prefs)

Attach a constraint map cts to a value map prefs of preferences. After some attachments have been done only the constraints with attached preferences are taken into account for relaxation.

Parameters:

cts
An IloConstraintMap object holding the constraints to attach preferences to.
prefs
An IloNumMap object holding the preferences.

end

public void end()

Clears the memory used by this object


first

public void first()

Goes to the first relaxation.


getConstraint

public IloConstraint getConstraint() const

Returns the relaxed constraint.

Returns:

an IloConstraint object, can be null.

getLB

public IloNum getLB() const

Returns the lower bound.

Returns:

A num representing the lower bound.

getRelaxedLB

public IloNum getRelaxedLB() const

Returns the relaxed lower bound.

Returns:

A num representing the relaxed lower bound.

getRelaxedUB

public IloNum getRelaxedUB() const

Returns the relaxed upper bound.

Returns:

A num representing the relaxed upper bound.

getUB

public IloNum getUB() const

Returns the upper bound.

Returns:

A num representing the upper bound.

hasNext

public IloBool hasNext()

Returns true, if there another relaxation.

Returns:

true if there is another relaxation.

next

public void next()

Goes to the next relaxation.


printRelaxation

public IloInt printRelaxation(std::ostream & os)

Reports the relaxations needed to obtain a feasible problem, returns the number of relaxations found and changes the state of the invoking object to relaxation mode.

Returns:

An integer representing the number of relaxations.