Class ContinuousPiecewiseLinearFunction

  • All Implemented Interfaces:
    Function

    public final class ContinuousPiecewiseLinearFunction
    extends java.lang.Object
    implements Function
    Author:
    Michael Weiss
    • 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
      LinearFunction functionAt​(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.BigDecimal getY​(java.math.BigDecimal x)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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)
        Specified by:
        getY in interface Function