Package org.nuiton.math.matrix
Class SparseVectorIterator
java.lang.Object
org.nuiton.math.matrix.SparseVectorIterator
- All Implemented Interfaces:
VectorIterator
- Direct Known Subclasses:
SparseArrayVectorIterator,SparseHashVectorIterator
public abstract class SparseVectorIterator extends Object implements VectorIterator
- Version:
- $Revision$ Last update: $Date$ by : $Author$
- Author:
- poussin
-
Field Summary
Fields Modifier and Type Field Description protected intassignedPosprotected intassignedSizeprotected doubledefaultValueprotected doubleexcludeprotected booleanhasExcludeprotected intnextPosprotected doublenextValueprotected intposprotected intsizeprotected doublevalueprotected SparseVectorvector -
Constructor Summary
Constructors Constructor Description SparseVectorIterator(SparseVector vector)SparseVectorIterator(SparseVector vector, double exclude) -
Method Summary
Modifier and Type Method Description protected voidcomputeNextPosAndValue()intgetPosition()return linear position of current value in vectordoublegetValue()protected doublegetValue(int pos)booleanhasNext()doublenext()voidsetExclude(double exclude)voidsetValue(double value)
-
Field Details
-
hasExclude
protected boolean hasExclude -
exclude
protected double exclude -
vector
-
size
protected int size -
assignedPos
protected int assignedPos -
assignedSize
protected int assignedSize -
defaultValue
protected double defaultValue -
pos
protected int pos -
nextPos
protected int nextPos -
value
protected double value -
nextValue
protected double nextValue
-
-
Constructor Details
-
Method Details
-
setExclude
public void setExclude(double exclude)- Specified by:
setExcludein interfaceVectorIterator
-
computeNextPosAndValue
protected void computeNextPosAndValue() -
getValue
protected double getValue(int pos) -
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceVectorIterator
-
next
public double next()- Specified by:
nextin interfaceVectorIterator
-
getValue
public double getValue()- Specified by:
getValuein interfaceVectorIterator
-
setValue
public void setValue(double value)- Specified by:
setValuein interfaceVectorIterator
-
getPosition
public int getPosition()Description copied from interface:VectorIteratorreturn linear position of current value in vector- Specified by:
getPositionin interfaceVectorIterator- Returns:
-