edu.stanford.rsl.jpop
Class AdditiveFunctionAssembler

java.lang.Object
  extended by edu.stanford.rsl.jpop.AdditiveFunctionAssembler
All Implemented Interfaces:
FunctionAssembler

public class AdditiveFunctionAssembler
extends java.lang.Object
implements FunctionAssembler

Implements an additive FunctionAssembler meaning that it computes the sum element by element of each block result. This FunctionAssembler can be used as an example for alternative FunctionAssembler implementations.

Author:
akmaier

Constructor Summary
AdditiveFunctionAssembler()
           
 
Method Summary
 double assembleEvaluationBlocks(double[] blockResults)
          This method is provided with an array of block results and assembles them into a single function evaluation result.
 double[] assembleGradientBlocks(double[][] blockResults)
          This method is provided with an array of gradients which were obtained by the different processing blocks.
 double[][] assembleHessianBlocks(double[][][] blockResults)
          This method is provided with an array of hessians as computed fron the parallel procesing blocks.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdditiveFunctionAssembler

public AdditiveFunctionAssembler()
Method Detail

assembleEvaluationBlocks

public double assembleEvaluationBlocks(double[] blockResults)
Description copied from interface: FunctionAssembler
This method is provided with an array of block results and assembles them into a single function evaluation result.

Specified by:
assembleEvaluationBlocks in interface FunctionAssembler
Parameters:
blockResults - the results of the processing blocks.
Returns:
the evaluation result

assembleGradientBlocks

public double[] assembleGradientBlocks(double[][] blockResults)
Description copied from interface: FunctionAssembler
This method is provided with an array of gradients which were obtained by the different processing blocks. The methods assembles the data into a single gradient vector. The first index of the gradient array is supposed to refer to the block number.

Specified by:
assembleGradientBlocks in interface FunctionAssembler
Parameters:
blockResults - the block results
Returns:
the assembled gradient vector

assembleHessianBlocks

public double[][] assembleHessianBlocks(double[][][] blockResults)
Description copied from interface: FunctionAssembler
This method is provided with an array of hessians as computed fron the parallel procesing blocks. The first index of the array should refer to the block index.

Specified by:
assembleHessianBlocks in interface FunctionAssembler
Parameters:
blockResults - the block results.
Returns:
the assembled Hessian.