de.unihalle.informatik.Alida.demo
Class MatrixSum

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.Alida.demo.MatrixSum
All Implemented Interfaces:
ALDConfigurationValidator

@ALDAOperator(genericExecutionMode=ALL,
              level=APPLICATION)
public class MatrixSum
extends ALDOperator

Demo operator to calculate colum or row sums of a 2D array.

Author:
posch

Nested Class Summary
static class MatrixSum.SummarizeMode
          Choose row or colum wise sum
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
ALDOperator.HidingMode
 
Field Summary
private  java.lang.Double[][] matrix
          Input matrix
private  MatrixSum.SummarizeMode summarizeMode
          Mode of summarizing
private  java.lang.Double[] sums
          1D Array of sums.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, portHashAccess, verbose, versionProvider
 
Constructor Summary
MatrixSum()
          Default constructor.
MatrixSum(java.lang.Double[][] _matrix)
          Constructor.
 
Method Summary
 java.lang.Double[] getSums()
          Returns the calculated sums.
protected  void operate()
          This method does the actual work and needs to be implemented by every subclass.
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
deserializeFromXmlFile, fieldContained, getALDPortHashAccessKey, getConstructionMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, isConfigured, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, readResolve, reinitializeParameterDescriptors, runOp, runOp, runOp, serializeToXmlFile, setConstructionMode, setName, setParameter, setParametersFromXml, setParametersFromXml, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matrix

@Parameter(label="Input matrix",
           required=true,
           direction=IN,
           description="Input matrix.")
private java.lang.Double[][] matrix
Input matrix


summarizeMode

@Parameter(label="Summarize mode",
           required=true,
           direction=IN,
           description="Sum over columns or rows?")
private MatrixSum.SummarizeMode summarizeMode
Mode of summarizing


sums

@Parameter(label="sums",
           direction=OUT,
           description="Row or column wise sums.")
private transient java.lang.Double[] sums
1D Array of sums.

Constructor Detail

MatrixSum

public MatrixSum()
          throws ALDOperatorException
Default constructor.

Throws:
ALDOperatorException

MatrixSum

public MatrixSum(java.lang.Double[][] _matrix)
          throws ALDOperatorException
Constructor.

Parameters:
matrix - Input matrix.
Throws:
ALDOperatorException
Method Detail

getSums

public java.lang.Double[] getSums()
Returns the calculated sums.

Returns:
row or column wise sums

operate

protected void operate()
                throws ALDOperatorException
Description copied from class: ALDOperator
This method does the actual work and needs to be implemented by every subclass.

Specified by:
operate in class ALDOperator
Throws:
ALDOperatorException