org.jmatrices.dbl.transformer
Interface MatrixConditionalEBETransformation


public interface MatrixConditionalEBETransformation

MatrixConditionalEBETransformation

Encapsulates a conditional operation that can be performed on each element of a matrix depending on their position

Usage:

 public static Matrix getScalarMatrix(int dim, final double scalar) {
       Matrix m = MatrixFactory.getMatrix(dim, dim);
       return MatrixEBETransformer.ebeTransform(m, new MatrixConditionalEBETransformation() {
           public double transform(int row, int col, double element) {
               if (row == col)
                   return scalar;
               return
                       element;
           }
       });
   }
 

Author: purangp

Date: 12.03.2004 Time: 20:20:20


Method Summary
 double transform(int row, int col, double element)
          Transforms an elements value into another value
 

Method Detail

transform

public double transform(int row,
                        int col,
                        double element)
Transforms an elements value into another value

Parameters:
row - row to which the element belongs
col - column to which the element belongs
element - value of the element at row,col
Returns:
transformed value