FRAMES NO FRAMES

Class IlcSoftCtHandler

Definition file: ilsolver/disjunct.h

The class IlcSoftCtHandler is used to manage the definition of a soft constraint. It contains information about the copied constraint, the copied variables and their relation to the original constraint and the original variables.

The parameter sh of type IlcSoftCtHandler is essential to understand the strength of the mechanism provided by IBM® ILOG® Solver.

The parameter sh is filled with some information when a soft constraint is created. This is quite useful to centralize some information when several soft constraints with the same IlcSoftCtHandler as argument.

IlcSoftCtHandler contains the following information:

All the functions of this class work with indices. This eases the access to additional data that the user would like to link to each original variable or to each original constraint.

Constructor Summary
public IlcSoftCtHandler()
public IlcSoftCtHandler(IlcSoftCtHandlerI * impl)
public IlcSoftCtHandler(IloSolver solver, IlcInt sizeMax)
Method Summary
public IlcConstraintgetConstraint(const IlcInt ct) const
public IlcIntVargetCopiedVar(const IlcInt cvar) const
public IlcIntgetCtOfSoftCt(const IlcInt softCt) const
public IlcIntgetFirstCopiedVarOfSoftCt(const IlcInt softCt) const
public IlcIntgetFirstCopiedVarOfVar(const IlcInt var) const
public IlcSoftCtHandlerI *getImpl() const
public IlcIntgetNextCopiedVarOfSoftCt(const IlcInt softCt, const IlcInt cvar) const
public IlcIntgetNextCopiedVarOfVar(const IlcInt var, const IlcInt cvar) const
public IlcIntgetNumCt() const
public IlcIntgetNumCvars() const
public IlcIntgetNumVars() const
public IlcSoftConstraintgetSoftConstraint(const IlcInt softCt) const
public IlcIntgetSoftCtOfCopiedVar(const IlcInt cvar) const
public IlcIntgetSoftCtOfCt(const IlcInt ct) const
public IloSolvergetSolver() const
public IlcIntVargetVar(const IlcInt var) const
public IlcIntgetVarOfCopiedVar(const IlcInt cvar) const
public voidoperator=(const IlcSoftCtHandler & h)
Constructor Detail

IlcSoftCtHandler

public IlcSoftCtHandler()

This constructor creates an empty handle. You must initialize it before you use it.


IlcSoftCtHandler

public IlcSoftCtHandler(IlcSoftCtHandlerI * impl)

This constructor creates a handle object from a pointer to an implementation object.


IlcSoftCtHandler

public IlcSoftCtHandler(IloSolver solver, IlcInt sizeMax)

The argument sizeMaxspecifices the maximum number of copied variables that can be handle by the invoked object.


Method Detail

getConstraint

public IlcConstraint getConstraint(const IlcInt ct) const

This member function returns the constraint of index ct.


getCopiedVar

public IlcIntVar getCopiedVar(const IlcInt cvar) const

This member function returns the copied variable of index cvar.


getCtOfSoftCt

public IlcInt getCtOfSoftCt(const IlcInt softCt) const

This member function returns the index of the constraint from which the soft constraint softct has been copied.


getFirstCopiedVarOfSoftCt

public IlcInt getFirstCopiedVarOfSoftCt(const IlcInt softCt) const

This member function returns the index of the first copied variable on which the soft constraint softct is defined.


getFirstCopiedVarOfVar

public IlcInt getFirstCopiedVarOfVar(const IlcInt var) const

This member function returns the index of the first copied variable of the variable corresponding to index var.


getImpl

public IlcSoftCtHandlerI * getImpl() const
This constructor creates an object by copying another one.

This member function returns a pointer to the implementation object of the invoking handle.


getNextCopiedVarOfSoftCt

public IlcInt getNextCopiedVarOfSoftCt(const IlcInt softCt, const IlcInt cvar) const

This member function returns the index of the next copied variable of cvar on which the soft constraint is defined.


getNextCopiedVarOfVar

public IlcInt getNextCopiedVarOfVar(const IlcInt var, const IlcInt cvar) const

This member function returns the index of the next copied variable of the copied variable cvar of the variable corresponding to index var.


getNumCt

public IlcInt getNumCt() const

This member function returns the number of constraints contained in the invoked object.


getNumCvars

public IlcInt getNumCvars() const

This member function returns the number of copied variables contained in the invoked object.


getNumVars

public IlcInt getNumVars() const

This member function returns the number of variables contained in the invoked object.


getSoftConstraint

public IlcSoftConstraint getSoftConstraint(const IlcInt softCt) const

This member function returns the copied constraint of index softct.


getSoftCtOfCopiedVar

public IlcInt getSoftCtOfCopiedVar(const IlcInt cvar) const

This member function returns the index of soft constraint softct involving the copied var.


getSoftCtOfCt

public IlcInt getSoftCtOfCt(const IlcInt ct) const

This member function returns the index of the soft constraint of the constraint ct.


getSolver

public IloSolver getSolver() const

This member function returns an instance of IloSolver associated with the invoking object.


getVar

public IlcIntVar getVar(const IlcInt var) const

This member function returns the variable of index var.


getVarOfCopiedVar

public IlcInt getVarOfCopiedVar(const IlcInt cvar) const

This member function returns the index of the original variable from which the copied variable has been copied.


operator=

public void operator=(const IlcSoftCtHandler & h)

This operator assigns an address to the handle pointer of the invoking object. That address is the location of the implementation object of the provided argument.