Class Maths

java.lang.Object
nz.org.riskscape.engine.function.Maths

public class Maths extends Object

Some general purpose mathematics functions using the RiskscapeFunction interface for use within the riskscape engine.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static nz.org.riskscape.engine.function.RiskscapeFunction
    newConstant(@NonNull Object constantValue)
    Returns a function that always returns the same value, regardless of the given parameter.
    static nz.org.riskscape.engine.function.RiskscapeFunction
    Returns a function to calculate LogNormalDistribution.cumulativeProbability(double) when passed arguments: 1) x 2) scale 3) shape
    static nz.org.riskscape.engine.function.RiskscapeFunction
    newCumulativeLogNormalDistribution(double scale, double shape)
    See LogNormalDistribution.cumulativeProbability(double)
    static nz.org.riskscape.engine.function.RiskscapeFunction
    Returns a function to calculate NormalDistribution.cumulativeProbability(double) when passed arguments: 1) x 2) mean 3) stdDev
    static nz.org.riskscape.engine.function.RiskscapeFunction
    newCumulativeNormalDistribution(double mean, double stdDev)
    See NormalDistribution.cumulativeProbability(double)
    static nz.org.riskscape.engine.function.RiskscapeFunction
    newPolynomial(double[] coefficients)
    See PolynomialFunction.value(double)
    static nz.org.riskscape.engine.function.RiskscapeFunction
    newPolynomial(int numberOfCoefficients)
    Returns a function to calculate PolynomialFunction.value(double) when passed arguments; 1) x 2) 1st degree ...
    static nz.org.riskscape.engine.function.RiskscapeFunction
    Returns a function to calculate Power.value(double) when passed arguments: 1) x 2) degree
    static nz.org.riskscape.engine.function.RiskscapeFunction
    newPower(double degree)
    See Power.value(double)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Maths

      public Maths()
  • Method Details

    • newPolynomial

      public static nz.org.riskscape.engine.function.RiskscapeFunction newPolynomial(double[] coefficients)

      See PolynomialFunction.value(double)

      Returns:
      an RiskscapeFunction wrapping a PolynomialFunction.
    • newPolynomial

      public static nz.org.riskscape.engine.function.RiskscapeFunction newPolynomial(int numberOfCoefficients)

      Returns a function to calculate PolynomialFunction.value(double) when passed arguments; 1) x 2) 1st degree ... n+1) n'th degree

      Parameters:
      numberOfCoefficients - function should expect
      Returns:
      an RiskscapeFunction wrapping a PolynomialFunction.
    • newPower

      public static nz.org.riskscape.engine.function.RiskscapeFunction newPower(double degree)

      See Power.value(double)

      Returns:
      an RiskscapeFunction wrapping a Power
    • newPower

      public static nz.org.riskscape.engine.function.RiskscapeFunction newPower()

      Returns a function to calculate Power.value(double) when passed arguments: 1) x 2) degree

      Returns:
      an RiskscapeFunction wrapping a Power
    • newCumulativeNormalDistribution

      public static nz.org.riskscape.engine.function.RiskscapeFunction newCumulativeNormalDistribution(double mean, double stdDev)

      See NormalDistribution.cumulativeProbability(double)

      Returns:
      an RiskscapeFunction wrapping a NormalDistribution
    • newCumulativeNormalDistribution

      public static nz.org.riskscape.engine.function.RiskscapeFunction newCumulativeNormalDistribution()

      Returns a function to calculate NormalDistribution.cumulativeProbability(double) when passed arguments: 1) x 2) mean 3) stdDev

      Returns:
      an RiskscapeFunction wrapping a NormalDistribution
    • newCumulativeLogNormalDistribution

      public static nz.org.riskscape.engine.function.RiskscapeFunction newCumulativeLogNormalDistribution(double scale, double shape)

      See LogNormalDistribution.cumulativeProbability(double)

      Returns:
      an RiskscapeFunction wrapping a LogNormalDistribution
    • newCumulativeLogNormalDistribution

      public static nz.org.riskscape.engine.function.RiskscapeFunction newCumulativeLogNormalDistribution()

      Returns a function to calculate LogNormalDistribution.cumulativeProbability(double) when passed arguments: 1) x 2) scale 3) shape

      Returns:
      an RiskscapeFunction wrapping a NormalDistribution
    • newConstant

      public static nz.org.riskscape.engine.function.RiskscapeFunction newConstant(@NonNull @NonNull Object constantValue)

      Returns a function that always returns the same value, regardless of the given parameter.

      Parameters:
      constantValue - the value to always return.
      Returns:
      a new RiskscapeFunction