public class FMatrixIterator
extends java.lang.Object
implements java.util.Iterator<java.lang.Float>
Constructor and Description |
---|
FMatrixIterator(FMatrixD1 a,
boolean rowMajor,
int minRow,
int minCol,
int maxRow,
int maxCol)
Creates a new iterator for traversing through a submatrix inside this matrix.
|
Modifier and Type | Method and Description |
---|---|
int |
getIndex()
Which element in the submatrix was returned by next()
|
boolean |
hasNext() |
boolean |
isRowMajor()
True if it is iterating through the matrix by rows and false if by columns.
|
java.lang.Float |
next() |
void |
remove() |
void |
set(float value)
Sets the value of the current element.
|
public FMatrixIterator(FMatrixD1 a, boolean rowMajor, int minRow, int minCol, int maxRow, int maxCol)
a
- the matrix it is iterating throughrowMajor
- true means it will traverse through the submatrix by row first, false by columns.minRow
- first row it will start at.minCol
- first column it will start at.maxRow
- last row it will stop at.maxCol
- last column it will stop at.public boolean hasNext()
hasNext
in interface java.util.Iterator<java.lang.Float>
public java.lang.Float next()
next
in interface java.util.Iterator<java.lang.Float>
public void remove()
remove
in interface java.util.Iterator<java.lang.Float>
public int getIndex()
public boolean isRowMajor()
public void set(float value)
value
- The element's new value.