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

mikera.indexz.impl.ComputedIndex 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.indexz.impl;

import mikera.indexz.AIndex;

/**
 * Abstract base class for computed indexes.
 * 
 * Intended for extension via an (anonymous) inner class.
 * 
 * @author Mike
 *
 */
@SuppressWarnings("serial")
public abstract class ComputedIndex extends AIndex {
	protected final int length;
	
	public ComputedIndex(int length) {
		assert(length>=0);
		this.length=length;
	}

	@Override
	public boolean isFullyMutable() {
		return false;
	}
	
	@Override
	public final int length() {
		return length;
	}
	
	@Override
	public int indexPosition(int x) {
		for (int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy