mikera.arrayz.impl.SliceIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vectorz Show documentation
Show all versions of vectorz Show documentation
Fast double-precision vector and matrix maths library for Java, supporting N-dimensional numeric arrays.
package mikera.arrayz.impl;
import java.util.Iterator;
import mikera.arrayz.INDArray;
import mikera.vectorz.util.ErrorMessages;
/**
* General purpose iterator for slices of arbitrary arrays.
*
* @author Mike
*/
public class SliceIterator implements Iterator {
private final INDArray source;
private final int maxPos;
private int pos;
public SliceIterator(INDArray source) {
this.pos=0;
this.source=source;
this.maxPos=source.sliceCount();
}
public SliceIterator(INDArray source, int start, int length) {
this.pos=start;
this.source=source;
this.maxPos=start+length;
}
@Override
public boolean hasNext() {
return pos
© 2015 - 2025 Weber Informatics LLC | Privacy Policy