com.cra.bnet.engine
Class EngineUtilities

java.lang.Object
  |
  +--com.cra.bnet.engine.EngineUtilities

public class EngineUtilities
extends Object

BNet engine utility methods.


Method Summary
static BigDecimal[] ensureSum(double[] x, int digits, BigDecimal target)
          Returns a big decimal array containing the elements of the specified double array rounded off to the specified number of significant digits that add up exactly to the specified target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ensureSum

public static BigDecimal[] ensureSum(double[] x,
                                     int digits,
                                     BigDecimal target)
Returns a big decimal array containing the elements of the specified double array rounded off to the specified number of significant digits that add up exactly to the specified target.

Parameters:
x - array of doubles.
digits - number of significant digits.
target - desired sum of returned numbers.
Returns:
numbers with specified significant digits that sum to desired target.