gurobi
Class GRBConstr

java.lang.Object
  extended by gurobi.GRBConstr

public class GRBConstr
extends java.lang.Object

Gurobi constraint object. Constraints are always associated with a particular model. You create a constraint object by adding a constraint to a model (using @link GRBModel#addConstr GRBModel.addConstr), rather than by using a @code GRBConstr constructor.

The methods on constraint objects are used to get and set constraint attributes. For example, constraint right-hand sides can be queried by calling @link GRBConstr#get get(@code GRB.DoubleAttr.RHS). Note, however, that it is generally more efficient to query attributes for a set of constraints at once. This is done using the attribute query method on the @code GRBModel object (@link GRBModel#get GRBModel.get).


Method Summary
protected  void finalize()
           
 char get(GRB.CharAttr attr)
          Query the value of a char-valued attribute.
 double get(GRB.DoubleAttr attr)
          Query the value of a double-valued attribute.
 int get(GRB.IntAttr attr)
          Query the value of an int-valued attribute.
 java.lang.String get(GRB.StringAttr attr)
          Query the value of a string-valued attribute.
 int index()
          This method returns the current index, or order, of the constraint in the underlying constraint matrix.
 boolean sameAs(GRBConstr otherConstr)
          Check whether two constraint objects refer to the same constraint.
 void set(GRB.CharAttr attr, char newval)
          Set the value of a char-valued attribute.
 void set(GRB.DoubleAttr attr, double newval)
          Set the value of a double-valued attribute.
 void set(GRB.IntAttr attr, int newval)
          Set the value of an int-valued attribute.
 void set(GRB.StringAttr attr, java.lang.String newval)
          Set the value of a string-valued attribute.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

sameAs

public boolean sameAs(GRBConstr otherConstr)
Check whether two constraint objects refer to the same constraint.

Parameters:
otherConstr - The other constraint.
Returns:
Boolean result indicates whether the two constraint objects refer to the same model constraint.

index

public int index()
This method returns the current index, or order, of the constraint in the underlying constraint matrix.

Note that the index of a constraint may change after subsequent model modifications.

Returns:
-2: removed, -1: not in model, otherwise: index of the constraint in the model

get

public int get(GRB.IntAttr attr)
        throws GRBException
Query the value of an int-valued attribute.

Parameters:
attr - The attribute being queried.
Returns:
The current value of the requested attribute.
Throws:
GRBException

get

public char get(GRB.CharAttr attr)
         throws GRBException
Query the value of a char-valued attribute.

Parameters:
attr - The attribute being queried.
Returns:
The current value of the requested attribute.
Throws:
GRBException

get

public double get(GRB.DoubleAttr attr)
           throws GRBException
Query the value of a double-valued attribute.

Parameters:
attr - The attribute being queried.
Returns:
The current value of the requested attribute.
Throws:
GRBException

get

public java.lang.String get(GRB.StringAttr attr)
                     throws GRBException
Query the value of a string-valued attribute.

Parameters:
attr - The attribute being queried.
Returns:
The current value of the requested attribute.
Throws:
GRBException

set

public void set(GRB.IntAttr attr,
                int newval)
         throws GRBException
Set the value of an int-valued attribute.

Parameters:
attr - The attribute being modified.
newval - The desired new value of the attribute.
Throws:
GRBException

set

public void set(GRB.CharAttr attr,
                char newval)
         throws GRBException
Set the value of a char-valued attribute.

Parameters:
attr - The attribute being modified.
newval - The desired new value of the attribute.
Throws:
GRBException

set

public void set(GRB.DoubleAttr attr,
                double newval)
         throws GRBException
Set the value of a double-valued attribute.

Parameters:
attr - The attribute being modified.
newval - The desired new value of the attribute.
Throws:
GRBException

set

public void set(GRB.StringAttr attr,
                java.lang.String newval)
         throws GRBException
Set the value of a string-valued attribute.

Parameters:
attr - The attribute being modified.
newval - The desired new value of the attribute.
Throws:
GRBException