org.jmatrices.dbl.transformer
Interface MatrixEBETransformation


public interface MatrixEBETransformation

MatrixEBETransformation

Encapsulates an operation that can be performed on each element of a matrix

Meant for scalar ebe transformations or ebe function application.

Examples: As annonymous classes ..

 private static Matrix scalarAddition(Matrix m, final double s) {
       return MatrixEBETransformer.ebeTransform(m, new MatrixEBETransformation() {
           public double transform(double element) {
               return element + s; //could be +, *, -, /
           }
       });
   }
 
 // unary minus or negation
 new MatrixEBETransformation() {
      double transform(double element) {
          return -element;
      }
 };
 
 //scalar multiplication
 new MatrixEBETransformation() {
      double transform(double element) {
          return 2 * element;
      }
 };
 
 // function application
 new MatrixEBETransformation() {
      double transform(double element) {
          return Math.sin(element);
      }
 };
 

This interface may be dropped in the future in favour of the conditional one as that one essentially allows for everything that this interface allows .. or we might drop the MatrixConditionalEBETransformation, replacing the method here with the one in MatrixConditionalEBETransformation

Author: purangp

Date: 07.03.2004 Time: 15:54:31

See Also:
MatrixEBETransformer

Method Summary
 double transform(double element)
          Transforms an elements value into another value
 

Method Detail

transform

public double transform(double element)
Transforms an elements value into another value

Parameters:
element - value of the element
Returns:
transformed value