Class ContinuousPiecewiseLinearFunction
- java.lang.Object
-
- org.spectrumauctions.sats.core.util.math.ContinuousPiecewiseLinearFunction
-
-
Constructor Summary
Constructors Constructor Description ContinuousPiecewiseLinearFunction(java.util.Map<java.math.BigDecimal,java.math.BigDecimal> cornerPoints)Constructs a new PieceWiseLinear function with a restricted domain interval
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinearFunctionfunctionAt(java.math.BigDecimal x)java.util.List<java.util.AbstractMap.SimpleImmutableEntry<java.math.BigDecimal,java.math.BigDecimal>>getCornerPoints()Provides a list with all corner point (X, Y) pairs, sorted with increasing X.java.math.BigDecimalgetY(java.math.BigDecimal x)
-
-
-
Constructor Detail
-
ContinuousPiecewiseLinearFunction
public ContinuousPiecewiseLinearFunction(java.util.Map<java.math.BigDecimal,java.math.BigDecimal> cornerPoints)
Constructs a new PieceWiseLinear function with a restricted domain interval- Parameters:
cornerPoints- A map with key = x-values and value = y-values. The map has to include all corner points of the function, including lower and upper end of domain.
-
-
Method Detail
-
getCornerPoints
public java.util.List<java.util.AbstractMap.SimpleImmutableEntry<java.math.BigDecimal,java.math.BigDecimal>> getCornerPoints()
Provides a list with all corner point (X, Y) pairs, sorted with increasing X. The return type is a list (instead of a sorted map) to allow easy indexing.- Returns:
- a list of the corner points
-
getY
public java.math.BigDecimal getY(java.math.BigDecimal x)
-
functionAt
public LinearFunction functionAt(java.math.BigDecimal x) throws NotDifferentiableException
- Throws:
NotDifferentiableException
-
-