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

Package class diagram package MatrixAsLPModelMatrix
java.lang.Object
  extended by net.sourceforge.combean.mathprog.lp.model.AbstractLPModelComponent
      extended by net.sourceforge.combean.mathprog.lp.model.AbstractSimpleIndexLPModelComponent
          extended by net.sourceforge.combean.mathprog.lp.model.MatrixAsLPModelMatrix
All Implemented Interfaces:
AbstractMatrix, LPModelColumns, LPModelComponent, LPModelMatrix, LPModelRows

public class MatrixAsLPModelMatrix
extends AbstractSimpleIndexLPModelComponent
implements LPModelMatrix

Use a simple matrix as matrix in an LP-model. The matrix is placed in the model by using one column offset and one row offset.


Field Summary
 
Fields inherited from class net.sourceforge.combean.mathprog.lp.model.AbstractSimpleIndexLPModelComponent
columnOffsetId, rowOffsetId
 
Constructor Summary
MatrixAsLPModelMatrix(VectorOrientation orientation, String rowOffsetId, String columnOffsetId, Matrix wrappedMatrix)
          Constructor.
 
Method Summary
 LPModelIndex getColumnModelIndex(int localColumn)
          Convert a local index into a model index.
 LPSparseVector getColumnVector(int localColumn)
           
 int getNumColumns()
          Return the number of columns of the model component.
 int getNumRows()
          Return the number of rows of the model component.
 LPModelIndex getRowModelIndex(int localRow)
          Convert a local index into a model index.
 LPSparseVector getRowVector(int localRow)
           
 void setOrientation(VectorOrientation newOrientation)
          Only to be used by subclasses: Set the orientation.
 String toString()
           
 
Methods inherited from class net.sourceforge.combean.mathprog.lp.model.AbstractSimpleIndexLPModelComponent
getColumnOffsetId, getColumnOffsetIds, getRowOffsetId, getRowOffsetIds, setColumnOffsetId, setRowOffsetId
 
Methods inherited from class net.sourceforge.combean.mathprog.lp.model.AbstractLPModelComponent
getOrientation
 
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.LPModelComponent
getColumnOffsetIds, getOrientation, getRowOffsetIds
 

Constructor Detail

MatrixAsLPModelMatrix

public MatrixAsLPModelMatrix(VectorOrientation orientation,
                             String rowOffsetId,
                             String columnOffsetId,
                             Matrix wrappedMatrix)
Constructor.

Parameters:
wrappedMatrix - the Matrix to be wrapped.
Method Detail

getRowModelIndex

public LPModelIndex getRowModelIndex(int localRow)
Description copied from interface: LPModelRows
Convert a local index into a model index.

Specified by:
getRowModelIndex in interface LPModelRows
Overrides:
getRowModelIndex in class AbstractSimpleIndexLPModelComponent
Parameters:
localRow - the local row.
Returns:
the correponding model index.

getColumnModelIndex

public LPModelIndex getColumnModelIndex(int localColumn)
Description copied from interface: LPModelColumns
Convert a local index into a model index.

Specified by:
getColumnModelIndex in interface LPModelColumns
Overrides:
getColumnModelIndex in class AbstractSimpleIndexLPModelComponent
Parameters:
localColumn - the local column.
Returns:
the correponding model index.

getRowVector

public LPSparseVector getRowVector(int localRow)
Specified by:
getRowVector in interface LPModelRows

getColumnVector

public LPSparseVector getColumnVector(int localColumn)
Specified by:
getColumnVector in interface LPModelColumns

getNumColumns

public int getNumColumns()
Description copied from interface: AbstractMatrix
Return the number of columns of the model component.

Specified by:
getNumColumns in interface AbstractMatrix
Returns:
the number of columns.

getNumRows

public int getNumRows()
Description copied from interface: AbstractMatrix
Return the number of rows of the model component.

Specified by:
getNumRows in interface AbstractMatrix
Returns:
the number of rows.

setOrientation

public void setOrientation(VectorOrientation newOrientation)
Description copied from class: AbstractLPModelComponent
Only to be used by subclasses: Set the orientation.

Specified by:
setOrientation in interface LPModelMatrix
Overrides:
setOrientation in class AbstractLPModelComponent
Parameters:
newOrientation - The orientation to set.

toString

public String toString()
Overrides:
toString in class AbstractLPModelComponent