All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mikera.arrayz.impl.SliceIterator Maven / Gradle / Ivy

Go to download

Fast double-precision vector and matrix maths library for Java, supporting N-dimensional numeric arrays.

There is a newer version: 0.67.0
Show newest version
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