Class Maths
Some general purpose mathematics functions using the RiskscapeFunction
interface for use within
the riskscape engine.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 calculateLogNormalDistribution.cumulativeProbability(double)
when passed arguments: 1) x 2) scale 3) shapestatic nz.org.riskscape.engine.function.RiskscapeFunction
newCumulativeLogNormalDistribution
(double scale, double shape) SeeLogNormalDistribution.cumulativeProbability(double)
static nz.org.riskscape.engine.function.RiskscapeFunction
Returns a function to calculateNormalDistribution.cumulativeProbability(double)
when passed arguments: 1) x 2) mean 3) stdDevstatic nz.org.riskscape.engine.function.RiskscapeFunction
newCumulativeNormalDistribution
(double mean, double stdDev) SeeNormalDistribution.cumulativeProbability(double)
static nz.org.riskscape.engine.function.RiskscapeFunction
newPolynomial
(double[] coefficients) SeePolynomialFunction.value(double)
static nz.org.riskscape.engine.function.RiskscapeFunction
newPolynomial
(int numberOfCoefficients) Returns a function to calculatePolynomialFunction.value(double)
when passed arguments; 1) x 2) 1st degree ...static nz.org.riskscape.engine.function.RiskscapeFunction
newPower()
Returns a function to calculatePower.value(double)
when passed arguments: 1) x 2) degreestatic nz.org.riskscape.engine.function.RiskscapeFunction
newPower
(double degree) SeePower.value(double)
-
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 aPolynomialFunction
.
-
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 aPolynomialFunction
.
-
newPower
public static nz.org.riskscape.engine.function.RiskscapeFunction newPower(double degree) See
Power.value(double)
- Returns:
- an
RiskscapeFunction
wrapping aPower
-
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 aPower
-
newCumulativeNormalDistribution
public static nz.org.riskscape.engine.function.RiskscapeFunction newCumulativeNormalDistribution(double mean, double stdDev) See
NormalDistribution.cumulativeProbability(double)
- Returns:
- an
RiskscapeFunction
wrapping aNormalDistribution
-
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 aNormalDistribution
-
newCumulativeLogNormalDistribution
public static nz.org.riskscape.engine.function.RiskscapeFunction newCumulativeLogNormalDistribution(double scale, double shape) See
LogNormalDistribution.cumulativeProbability(double)
- Returns:
- an
RiskscapeFunction
wrapping aLogNormalDistribution
-
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 aNormalDistribution
-
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
-