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 int
assignedPos
protected long
assignedSize
protected double
defaultValue
protected double
exclude
protected boolean
hasExclude
protected long
nextPos
protected double
nextValue
protected long
pos
protected long
size
protected double
value
protected SparseVector
vector
-
Constructor Summary
Constructors Constructor Description SparseVectorIterator(SparseVector vector)
SparseVectorIterator(SparseVector vector, double exclude)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
computeNextPosAndValue()
long
getPosition()
return linear position of current value in vectordouble
getValue()
protected double
getValue(long pos)
boolean
hasNext()
double
next()
void
setExclude(double exclude)
void
setValue(double value)
-
-
-
Field Detail
-
hasExclude
protected boolean hasExclude
-
exclude
protected double exclude
-
vector
protected SparseVector vector
-
size
protected long size
-
assignedPos
protected int assignedPos
-
assignedSize
protected long assignedSize
-
defaultValue
protected double defaultValue
-
pos
protected long pos
-
nextPos
protected long nextPos
-
value
protected double value
-
nextValue
protected double nextValue
-
-
Constructor Detail
-
SparseVectorIterator
public SparseVectorIterator(SparseVector vector)
-
SparseVectorIterator
public SparseVectorIterator(SparseVector vector, double exclude)
-
-
Method Detail
-
setExclude
public void setExclude(double exclude)
- Specified by:
setExclude
in interfaceVectorIterator
-
computeNextPosAndValue
protected void computeNextPosAndValue()
-
getValue
protected double getValue(long pos)
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceVectorIterator
-
next
public double next()
- Specified by:
next
in interfaceVectorIterator
-
getValue
public double getValue()
- Specified by:
getValue
in interfaceVectorIterator
-
setValue
public void setValue(double value)
- Specified by:
setValue
in interfaceVectorIterator
-
getPosition
public long getPosition()
Description copied from interface:VectorIterator
return linear position of current value in vector- Specified by:
getPosition
in interfaceVectorIterator
- Returns:
-
-