net.sourceforge.combean.mathprog.lp.model
Class SparseVectorAsLPVector
java.lang.Object
net.sourceforge.combean.mathprog.lp.model.SparseVectorAsLPVector
- All Implemented Interfaces:
- SparseVec<LPVectorLabel>, LPSparseVector
public class SparseVectorAsLPVector
- extends Object
- implements LPSparseVector
label
protected LPVectorLabelImpl label
SparseVectorAsLPVector
public SparseVectorAsLPVector(SparseVector wrappedVec,
String offsetId,
VectorOrientation orientation)
- Parameters:
wrappedVec
-
getDimension
public int getDimension()
iterator
public VectorIterator<LPVectorLabel> iterator()
- Description copied from interface:
SparseVec
- Get an iterator which iterates through all non-zero entries
of the vector. The iteration must stop after exactly
getNumNonZeroEntries() steps.
An implementation may choose to also return zero entries
during the iteration. In that case, these entries must also
be counted by getNumIterations();
The iteration does not have to return the values in order of
increasing indices.
- Specified by:
iterator
in interface SparseVec<LPVectorLabel>
- Returns:
- an iterator for the non-zero entries.
getNumIterations
public int getNumIterations()
- Description copied from interface:
SparseVec
- Return the number of entries of the vector through which the
iterator returned by getIterator() iterates.
- Specified by:
getNumIterations
in interface SparseVec<LPVectorLabel>
- Returns:
- the number of iterations of getIterator.
toString
public String toString()
- Overrides:
toString
in class Object