net.sourceforge.combean.mathprog.lp.model
Class AbstractLPVariableSequence

Package class diagram package AbstractLPVariableSequence
java.lang.Object
  extended by net.sourceforge.combean.mathprog.lp.model.AbstractLPVariableSequence
All Implemented Interfaces:
LPVariableSequence
Direct Known Subclasses:
DoubleLPVariableSequence, EdgesAsLPVariableSequence

public abstract class AbstractLPVariableSequence
extends Object
implements LPVariableSequence

An abstract base class for an LP variable sequences. Takes care of the offset id and the offset and makes own implementations of LPVariableSequence a bit simpler.


Field Summary
 
Fields inherited from interface net.sourceforge.combean.interfaces.mathprog.lp.model.LPVariableSequence
OFFSET_UNDEFINED
 
Constructor Summary
AbstractLPVariableSequence(String offsetId)
           
AbstractLPVariableSequence(String offsetId, boolean isInteger)
           
 
Method Summary
 LPModelIndex getColumnModelIndex(int localColumn)
          Create a column model index for a given local index.
 int getVarOffset()
          Get the global index of the first element of the sequence.
 String getVarOffsetId()
          Return the identifier for the offset in the global LP model.
 boolean isInteger()
          Flag whether the variables in the sequence are integer variables.
 void setIntegerFlag(boolean isInteger)
           
 void setVarOffset(int offset)
          Set the offset, i.e., the index of the first row resp. column of the sequence in the global model.
 void setVarOffsetId(String offsetId)
          Set the identifier which defines the offset of the condition sequence in a global LP model.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.combean.interfaces.mathprog.lp.model.LPVariableSequence
getLPVariable, getNumVars
 

Constructor Detail

AbstractLPVariableSequence

public AbstractLPVariableSequence(String offsetId)

AbstractLPVariableSequence

public AbstractLPVariableSequence(String offsetId,
                                  boolean isInteger)
Method Detail

setVarOffsetId

public void setVarOffsetId(String offsetId)
Description copied from interface: LPVariableSequence
Set the identifier which defines the offset of the condition sequence in a global LP model.

Specified by:
setVarOffsetId in interface LPVariableSequence
Parameters:
offsetId - the offset identifier.

getVarOffsetId

public String getVarOffsetId()
Description copied from interface: LPVariableSequence
Return the identifier for the offset in the global LP model.

Specified by:
getVarOffsetId in interface LPVariableSequence
Returns:
the identifier for the offset in the global LP model.

setVarOffset

public void setVarOffset(int offset)
Description copied from interface: LPVariableSequence
Set the offset, i.e., the index of the first row resp. column of the sequence in the global model.

Specified by:
setVarOffset in interface LPVariableSequence
Parameters:
offset - the global index of the first element of the sequence.

getVarOffset

public int getVarOffset()
Description copied from interface: LPVariableSequence
Get the global index of the first element of the sequence.

Specified by:
getVarOffset in interface LPVariableSequence
Returns:
the global index of the first element of the sequence.

toString

public String toString()
Overrides:
toString in class Object

getColumnModelIndex

public LPModelIndex getColumnModelIndex(int localColumn)
Create a column model index for a given local index.

Parameters:
localColumn - the local index
Returns:
the corresponding column model index

isInteger

public boolean isInteger()
Description copied from interface: LPVariableSequence
Flag whether the variables in the sequence are integer variables. Please note that you need a MIPSolver to solve the model if you have variables that are integer.

Specified by:
isInteger in interface LPVariableSequence

setIntegerFlag

public void setIntegerFlag(boolean isInteger)