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

com.meliorbis.numerics.generic.UnaryOp Maven / Gradle / Ivy

Go to download

A library for working with large multi-dimensional arrays and the functions they represent

There is a newer version: 1.2
Show newest version
package com.meliorbis.numerics.generic;

/**
 * The specialisation of NaryOp for operations that accept only one parameter
 * 
 * @param  The input and output type of the operation
 * @param  The exception thrown by the operation
 * 
 * @author Tobias Grasl
 */
public interface UnaryOp extends NaryOp
{
	/**
	 * Performs the operation
	 * 
	 * @param operand_ The single input to the operation
	 * 
	 * @return The result of the operation
	 *  
	 * @throws E If the operation fails
	 */
    public T perform(T operand_) throws E;

    /**
     * Overrides the superclass method to delegate to the unary method
     * 
     * @param inputs_ The input to the operation, should be of length 1
     * 
     * @return The result of the operation
     * 
     * @throws E If the operation fails.
     */
    @Override
    default T perform(@SuppressWarnings("unchecked") T... inputs_) throws E
    {
        return perform(inputs_[0]);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy