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