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

mikera.transformz.impl.AOpTransform 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.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