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

com.meliorbis.numerics.generic.Mappable 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;



/**
 * An interface for collection objects on which operations can be performed. The member type is T, and the resulting
 * object type is R
 *
 * @param  The individual element type
 * @param  The return type of mapping operations, which will commonly be the most derived type of this. This parameter is
 *           used to avoid the need to cast
 */
public interface Mappable>
{
    /**
     * An IOperand which adds the otherArrays alongside this one, for n-ary operations
     *
     * @param otherArrays_ The other operands on which an operation is to be performed
     * 
     * @param  The type of the array(s) being operated with
     *
     * @return An IMappable, operations performed on which will use both this and otherArrays_
     */
	 Mappable with(@SuppressWarnings("unchecked") MultiDimensionalArray... otherArrays_);

    /**
     * Performs the provided operation on each element of this operand, returning the result
     *
     * @param operation_ The operation to perform
     *
     * @param  The type of exception thrown by the op
     * 
     * @return The result of the operation
     * 
     * @throws E If the operation fails
     */
     RM map(NaryOp operation_) throws E;
    
    /**
     * Performs the provided operation on each element of this operand, returning the result
     *
     * @param operation_ The operation to perform
     *
     * @param  The type of exception thrown by the op
     * 
     * @return The result of the operation
     * 
     * @throws E If the operation fails
     */
     RM[] map(MultiValuedNaryOp operation_) throws E;
}