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

mikera.transformz.OpTransform 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.transformz;

import mikera.vectorz.AVector;
import mikera.vectorz.Op;

public class OpTransform extends ASizedTransform {
	private final Op op;

	public OpTransform(Op op, int size) {
		super(size);
		this.op=op;
	}
	
	@Override
	public void transform(AVector source, AVector dest) {
		dest.set(source);
		op.applyTo(dest);
	}
	
	
	@Override 
	public boolean isInvertible() {
		return op.hasInverse();
	}
	
	@Override 
	public OpTransform inverse() {
		Op invOp=op.getInverse();
		if (op==null) throw new UnsupportedOperationException("Operator "+ op + " does not have an inverse");
		return new OpTransform(invOp,size);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy