mikera.transformz.impl.AOpTransform 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.impl;
import mikera.transformz.ATransform;
import mikera.vectorz.AVector;
import mikera.vectorz.Op;
import mikera.vectorz.util.ErrorMessages;
/**
* A transform the represents the application of an operator to all elements of a vector
*
* @author Mike
*
*/
public class AOpTransform extends ATransform {
private final Op op;
private final int dims;
public AOpTransform(Op op, int dims) {
this.op=op;
this.dims=dims;
}
@Override
public void transform(AVector source, AVector dest) {
if ((source.length()!=dims)) throw new IllegalArgumentException(ErrorMessages.wrongSourceLength(source));
if ((dest.length()!=dims)) throw new IllegalArgumentException(ErrorMessages.wrongDestLength(source));
for (int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy