Class PiecewiseFunction

java.lang.Object
com.amalgamasimulation.core.piecewise.PiecewiseFunction

public class PiecewiseFunction extends Object
Represents a piecewise linear function with step changes. The function's domain for both arguments and values is [-∞, +∞].

Step changes occur at specified finite arguments, shifting the value at the respective argument by the size of the step.

Rate changes apply to argument intervals, representing linear growth or decrease of value over the argument.

Author:
Andrey Malykhanov, Alexander Morozov
  • Constructor Details

    • PiecewiseFunction

      public PiecewiseFunction()
      Creates a new empty (constant zero) piecewise function.
    • PiecewiseFunction

      public PiecewiseFunction(List<Pair<Double,Double>> plotPoints)
      Creates a new piecewise function by its plot points. For example, if we need to create the following function, we must supply these points:

      Parameters:
      plotPoints - plot points of the piecewise function being created. Arguments cannot be Double.NaN. Values must be finite and not Double.NaN. Points should be sorted by argument in non-descending order. The first point with an argument greater than negative infinity must have a value equal to the value of the point at negative infinity, or zero if that point is the first.
      See Also:
  • Method Details

    • segmentsIterator

      public Iterator<PiecewiseFunction.FunctionSegment> segmentsIterator(Interval argumentInterval)
      Returns an iterator over the PiecewiseFunction.FunctionSegment instances within the specified argument interval. Each segment represents a section of the function where it behaves linearly or has a constant rate.

      If the provided argument interval is empty, the iterator will contain no elements.

      Parameters:
      argumentInterval - the interval within which to retrieve the function segments, can be Interval.EMPTY or Interval.UNIVERSE
      Returns:
      an iterator over the PiecewiseFunction.FunctionSegment instances within the specified argument interval
    • segmentsStream

      public Stream<PiecewiseFunction.FunctionSegment> segmentsStream(Interval argumentInterval)
      Returns a stream of PiecewiseFunction.FunctionSegment instances within the specified argument interval. Each segment represents a section of the function where it behaves linearly or has a constant rate.
      Parameters:
      argumentInterval - the interval within which to retrieve the function segments, can be Interval.EMPTY or Interval.UNIVERSE
      Returns:
      a stream of PiecewiseFunction.FunctionSegment instances within the specified argument interval
    • addStepChange

      public PiecewiseFunction addStepChange(double argument, double valueStep)
      Adds a step change to the piecewise linear function.

      Changes this instance and returns the reference to itself.

      Parameters:
      argument - the argument where the step change occurs. Cannot be Double.NaN
      valueStep - the size of the step change. Must be finite and not Double.NaN.
      Returns:
      reference to this PiecewiseFunction instance with the added step change

      Illustration:

    • addStepChange

      public PiecewiseFunction addStepChange(Interval withinArgumentInterval, double valueStep)
      Adds a step change to the piecewise linear function within the specified interval.

      More specifically, adds a step change of valueStep at the min boundary of the interval, and a step change of -valueStep at the max boundary of the interval.

      Changes this instance and returns the reference to itself.

      Parameters:
      withinArgumentInterval - the interval where the step change occurs. Must be finite and not null
      valueStep - the size of the step change. Must be finite and not Double.NaN
      Returns:
      a reference to this PiecewiseFunction instance with the added step change

      Illustration:

    • addRate

      public PiecewiseFunction addRate(double fromArgument, double rateDelta)
      Adds a rate change to this piecewise linear function, starting from the specified argument. The rate change represents a linear growth or decrease in value over the argument interval.

      Changes this instance and returns the reference to itself.

      Parameters:
      fromArgument - the starting argument for the rate change. Must be finite and not Double.NaN
      rateDelta - the rate of change to be applied. Must be finite and not Double.NaN
      Returns:
      a reference to this PiecewiseFunction instance with the added rate change

      Illustration:

    • addRate

      public PiecewiseFunction addRate(Interval withinArgumentInterval, double rateDelta)
      Adds a rate change to the piecewise linear function within the specified interval. The rate change represents a linear growth or decrease in value over the interval.

      More specifically, adds a rate change of rateDelta at the min boundary of the interval, and a rate change of -rateDelta at the max boundary of the interval.

      Changes this instance and returns the reference to itself.

      Parameters:
      withinArgumentInterval - the interval within which the rate change occurs Must be finite and not null.
      rateDelta - the rate of change to be applied. Must be finite and not Double.NaN
      Returns:
      a reference to this PiecewiseFunction instance with the added rate change

      Illustration:

    • valueAt

      public double valueAt(double argument)
      Calculates the value of the piecewise linear function at the specified argument. If the argument corresponds to a step change, returns the value after this step change.
      Parameters:
      argument - the argument at which to evaluate the function, can be infinite. Must not be Double.NaN
      Returns:
      the value of the function at the specified argument, can be infinite

      Illustration:

    • derivative

      public PiecewiseFunction derivative()
      Calculates a derivative of this piecewise linear function with corresponding step changes at break points.
      Returns:
      a new PiecewiseFunction that represents a derivative of this piecewise linear function

      Illustration:

      See Also:
    • antiderivative

      public PiecewiseFunction antiderivative(double argumentIntegrationStep)
      Calculates an antiderivative of this piecewise linear function performing a stepwise integration of segments with non-zero rates.

      The rate of this piecewise function in both -∞ or +∞ must be equal to zero, as otherwise the antiderivative cannot be defined. If this is not the case, an IllegalStateException will be thrown.

      Parameters:
      argumentIntegrationStep - step of integrating, applied for segments of this function with non-zero rates, must be finite, positive, and not Double.NaN
      Returns:
      a new PiecewiseFunction that represents an antiderivative of this piecewise linear function

      Illustration:

    • rateAt

      public double rateAt(double argument)
      Calculates the rate of growth (or decrease in case of negative rate) of this function at the specified argument. If the argument corresponds to the point where the rate changes, returns the value after such rate change.
      Parameters:
      argument - the argument at which to calculate the rate of the function, can be infinite. Must not be Double.NaN
      Returns:
      the rate of the function at the specified argument, cannot be infinite

      Illustration:

    • shiftArgument

      public PiecewiseFunction shiftArgument(double argumentShift)
      Shifts the function along the argument (X) axis by the specified amount.

      Creates and returns a new instance of PiecewiseFunction; this instance remains unchanged.

      Parameters:
      argumentShift - the amount by which to shift along the argument (X) axis. Must be finite and not Double.NaN
      Returns:
      a new PiecewiseFunction instance shifted along the argument (X) axis by the specified amount

      Illustration:

    • shiftValue

      public PiecewiseFunction shiftValue(double valueShift)
      Shifts the function along the value (Y) axis by the specified amount.

      Creates and returns a new instance of PiecewiseFunction; this instance remains unchanged.

      Parameters:
      valueShift - the amount by which to shift along the value (Y) axis. Must be finite and not Double.NaN
      Returns:
      a new PiecewiseFunction instance shifted along the value (Y) axis by the specified amount

      Illustration:

    • subFunction

      public PiecewiseFunction subFunction(IntervalLike withinArgumentInterval)
      Computes and returns a new instance of PiecewiseFunction which is a sub-function of this function, i.e. function which is:
      • equal to this function inside the specified argument interval or interval set,
      • zero elsewhere.

      If the specified interval is Interval.UNIVERSE, returns a copy of this function. If the specified interval is Interval.EMPTY, or has a zero length, returns a constant zero function

      Parameters:
      withinArgumentInterval - argument where the values of this function are preserved, can be empty but must not be zero-length
      Returns:
      a new instance of PiecewiseFunction which is a sub-function of this function

      Illustration:

    • plotPoints

      public List<Pair<Double,Double>> plotPoints()
      Returns a list of points of a linear 2d-plot of this function. The returned list consists of Pair<Double,Double> instances. In each pair, the first element corresponds to the argument and the second element corresponds to the value. The list is ordered by argument in ascending order.

      Note that because of step changes, there can be up to 2 points for the same argument.

      Returns:
      list of points of linear 2d-plot of this function.
    • plotPoints

      public List<Pair<Double,Double>> plotPoints(Interval withinArgumentInterval)
      Returns a list of points of a linear 2d-plot plot of this function within the specified argument interval. The returned list consists of Pair<Double,Double> instances. In each pair, the first element corresponds to the argument and the second element corresponds to the value. The list is ordered by argument in ascending order.

      Note that because of step changes, there can be up to 2 points for the same argument.

      Parameters:
      withinArgumentInterval - the interval within which to look for the plot points. Must not be null.
      Returns:
      list of points of linear 2d-plot of this function.
    • breakPoints

      public List<PiecewiseFunction.BreakPoint> breakPoints()
      Returns a list of all break points in the piecewise function.

      The break points are sorted by their argument in ascending order.

      Returns:
      a list of PiecewiseFunction.BreakPoint instances representing break points.
    • breakPoints

      public List<PiecewiseFunction.BreakPoint> breakPoints(Interval withinArgumentInterval)
      Returns a list of break points in the piecewise function within a specified argument interval.

      The returned list contains only the break points whose arguments fall within the specified interval. The break points are sorted by their argument in ascending order.

      Parameters:
      withinArgumentInterval - the interval within which to find break points. Must not be null.
      Returns:
      a list of PiecewiseFunction.BreakPoint instances representing break points within the specified interval.
    • min

      Computes the minimum of this function and another piecewise function. Creates and returns a new instance of PiecewiseFunction which is the minimum of this function and another piecewise function. The current instance remains unchanged.
      Parameters:
      other - the other piecewise function, must not be null
      Returns:
      a new PiecewiseFunction instance which is the minimum of both functions

      Illustration:

    • max

      Computes the maximum of this function and another piecewise function. Creates and returns a new instance of PiecewiseFunction which is the maximum of this function and another piecewise function. The current instance remains unchanged.
      Parameters:
      other - the other piecewise function, must not be null
      Returns:
      a new PiecewiseFunction instance which is the maximum of both functions

      Illustration:

    • plus

      public PiecewiseFunction plus(PiecewiseFunction other)
      Adds the points of another piecewise function to this function. Creates and returns a new instance of PiecewiseFunction with the combined points. The current instance remains unchanged.
      Parameters:
      other - the other piecewise function whose points are to be added, must not be null
      Returns:
      a new PiecewiseFunction instance with the points of both functions combined

      Illustration:

    • minus

      public PiecewiseFunction minus(PiecewiseFunction other)
      Subtracts the points of another piecewise function from this function. Creates and returns a new instance of PiecewiseFunction with the points of the other function subtracted. The current instance remains unchanged.
      Parameters:
      other - the other piecewise function whose points are to be subtracted, must not be null
      Returns:
      a new PiecewiseFunction instance with the points of the other function subtracted

      Illustration:

    • multiply

      public PiecewiseFunction multiply(double factor)
      Multiplies the values of this piecewise function by the specified factor. Creates and returns a new instance of PiecewiseFunction with the values multiplied by the factor. The current instance remains unchanged.
      Parameters:
      factor - the factor by which to multiply the values of the function. Must be finite and not Double.NaN
      Returns:
      a new PiecewiseFunction instance with the values multiplied by the factor

      Illustration:

    • copy

      public PiecewiseFunction copy()
      Creates a new instance of this PiecewiseFunction that is a copy of this function, and returns this instance.
      Returns:
      a copy of this instance
    • firstArgumentWithValueMoreEqualThan

      public double firstArgumentWithValueMoreEqualThan(double moreEqualThanValue, double startingFromArgument)
      Finds and returns the first argument in the piecewise linear function where its value is greater than or equal to the specified threshold, starting the search from the given argument, inclusive.

      If the value of the function at the given argument is already greater than or equal to the specified threshold, returns this given argument.

      Parameters:
      moreEqualThanValue - the threshold value to compare against. Must be finite and not Double.NaN
      startingFromArgument - the argument from which to start the search, inclusive. Must not be Double.NaN
      Returns:
      the first argument where the value is greater than or equal to the specified threshold, or Double.POSITIVE_INFINITY if no such argument is found

      Illustration:

    • firstArgumentWithValueLessEqualThan

      public double firstArgumentWithValueLessEqualThan(double lessEqualThanValue, double startingFromArgument)
      Finds and returns the first argument in the piecewise linear function where its value is less than or equal to the specified threshold, starting the search from the given argument, inclusive.

      If the value of the function at the given argument is already less than or equal to the specified threshold, returns this given argument.

      Parameters:
      lessEqualThanValue - the threshold value to compare against. Must be finite and not Double.NaN
      startingFromArgument - the argument from which to start the search, inclusive. Must not be Double.NaN
      Returns:
      the first argument where the value is less than or equal to the specified threshold, or Double.POSITIVE_INFINITY if no such argument is found

      Illustration:

    • maxValue

      public double maxValue()
      Finds the maximum value of this function on the entire argument domain of [-∞, +∞].
      Returns:
      maximum value of this function on the entire argument domain of [-∞, +∞]

      Illustration:

    • maxValue

      public double maxValue(Interval withinArgumentInterval)
      Finds the maximum value of this piecewise linear function within the specified interval. Returns Double.NEGATIVE_INFINITY for Interval.EMPTY.
      Parameters:
      withinArgumentInterval - the interval within which to search for the maximum value Must not be null.
      Returns:
      the maximum value of the function within the specified interval, or Double.NEGATIVE_INFINITY

      Illustration:

    • minValue

      public double minValue()
      Finds the minimum value of this function on the entire argument domain of [-∞, +∞].
      Returns:
      minimum value of this function on the entire argument domain of [-∞, +∞]

      Illustration:

    • minValue

      public double minValue(Interval withinArgumentInterval)
      Finds the minimum value of this piecewise linear function within the specified interval. Returns Double.POSITIVE_INFINITY for Interval.EMPTY.
      Parameters:
      withinArgumentInterval - the interval within which to search for the minimum value Must not be null.
      Returns:
      the minimum value of the function within the specified interval, or Double.POSITIVE_INFINITY

      Illustration:

    • integral

      public double integral()
      Calculates the integral of the piecewise linear function over the entire argument domain of [-∞, +∞].
      Returns:
      the integral of the function over the entire argument domain of [-∞, +∞]

      Illustration:

    • integral

      public double integral(Interval withinArgumentInterval)
      Calculates the integral of the piecewise linear function over the specified argument interval.
      Parameters:
      withinArgumentInterval - the interval within which to calculate the integral. Must not be null.
      Returns:
      the integral of the function over the specified interval

      Illustration:

    • absoluteIntegral

      public double absoluteIntegral()
      Calculates the absolute integral of the piecewise linear function over the entire argument domain of [-∞, +∞].

      Absolute integral of a function is the integral of the absolute value of this function. It measures the total area between the function's plot and the argument (X) axis, disregarding the sign of the function's values.

      Returns:
      the absolute integral of the function over the entire argument domain of [-∞, +∞]

      Illustration:

    • absoluteIntegral

      public double absoluteIntegral(Interval withinArgumentInterval)
      Calculates the absolute integral of the piecewise linear function over the the specified argument interval.

      Absolute integral of a function is the integral of the absolute value of this function. It measures the total area between the function's plot and the argument (X) axis, disregarding the sign of the function's values.

      Parameters:
      withinArgumentInterval - the interval within which to calculate the integral. Must not be null.
      Returns:
      the absolute integral of the function over the specified argument interval

      Illustration:

    • positiveIntegral

      public double positiveIntegral()
      Calculates the integral of the positive part of the piecewise linear function over the entire argument domain of [-∞, +∞]. Positive integral measures the total area between the function's plot and the argument (X) axis considering only the parts of function where its value is positive.
      Returns:
      the integral of the positive part of the function over the entire argument domain of [-∞, +∞].

      Illustration:

    • positiveIntegral

      public double positiveIntegral(Interval withinArgumentInterval)
      Calculates the integral of the positive part of the piecewise linear function over the specified argument interval. Positive integral measures the total area between the function's plot and the argument (X) axis considering only the parts of function where its value is positive.
      Parameters:
      withinArgumentInterval - the interval within which to calculate the integral. Must not be null
      Returns:
      the integral of the positive part of the function over the specified argument interval.

      Illustration:

    • intervalsWithValueMoreEqualThan

      public IntervalSet intervalsWithValueMoreEqualThan(double valueMoreEqualThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's value is greater than or equal to the specified threshold.
      Parameters:
      valueMoreEqualThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's value is greater than or equal to the specified threshold

      Illustration:

    • intervalsWithRateMoreThan

      public IntervalSet intervalsWithRateMoreThan(Interval withinArgumentInterval, double rateMoreThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's change rate is greater than the specified threshold, within the specified argument interval.
      Parameters:
      withinArgumentInterval - the argument interval within which to find the intervals. Must not be null
      rateMoreThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's value is greater than the specified threshold

      Illustration:

    • intervalsWithRateMoreThan

      public IntervalSet intervalsWithRateMoreThan(double rateMoreThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's change rate is greater than the specified threshold.
      Parameters:
      rateMoreThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's rate is greater than the specified threshold

      Illustration:

    • intervalsWithRateLessThan

      public IntervalSet intervalsWithRateLessThan(Interval withinArgumentInterval, double rateLessThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's change rate is less than the specified threshold, within the specified argument interval.
      Parameters:
      withinArgumentInterval - the argument interval within which to find the intervals. Must not be null
      rateLessThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's value is less than the specified threshold

      Illustration:

    • intervalsWithRateLessThan

      public IntervalSet intervalsWithRateLessThan(double rateLessThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's change rate is less than the specified threshold.
      Parameters:
      rateLessThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's rate is less than the specified threshold

      Illustration:

    • intervalsWithValueMoreEqualThan

      public IntervalSet intervalsWithValueMoreEqualThan(Interval withinArgumentInterval, double valueMoreEqualThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's value is greater than or equal to the specified threshold.
      Parameters:
      withinArgumentInterval - the argument interval within which to find the intervals. Must not be null
      valueMoreEqualThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's value is greater than or equal to the specified threshold

      Illustration:

    • intervalsWithValueLessEqualThan

      public IntervalSet intervalsWithValueLessEqualThan(double valueLessEqualThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's value is less than or equal to the specified threshold.
      Parameters:
      valueLessEqualThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's value is less than or equal to the specified threshold

      Illustration:

    • intervalsWithValueLessEqualThan

      public IntervalSet intervalsWithValueLessEqualThan(Interval withinArgumentInterval, double valueLessEqualThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's value is less than or equal to the specified threshold.
      Parameters:
      withinArgumentInterval - the argument interval within which to find the intervals. Must not be null
      valueLessEqualThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's value is less than or equal to the specified threshold

      Illustration:

    • intervalsWithValueMoreThan

      public IntervalSet intervalsWithValueMoreThan(double valueMoreThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's value is greater than the specified threshold.
      Parameters:
      valueMoreThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's value is greater than the specified threshold

      Illustration:

    • intervalsWithValueMoreThan

      public IntervalSet intervalsWithValueMoreThan(Interval withinArgumentInterval, double valueMoreThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's value is greater than the specified threshold.
      Parameters:
      withinArgumentInterval - the argument interval within which to find the intervals. Must not be null
      valueMoreThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's value is greater than the specified threshold

      Illustration:

    • intervalsWithValueLessThan

      public IntervalSet intervalsWithValueLessThan(double valueLessThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's value is less than the specified threshold.
      Parameters:
      valueLessThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's value is less than the specified threshold

      Illustration:

    • intervalsWithValueLessThan

      public IntervalSet intervalsWithValueLessThan(Interval withinArgumentInterval, double valueLessThan)
      Finds and returns an IntervalSet instance describing the sorted set of intervals where this piecewise function's value is less than the specified threshold.
      Parameters:
      withinArgumentInterval - the argument interval within which to find the intervals. Must not be null
      valueLessThan - the threshold value to compare against. Must be finite and not Double.NaN
      Returns:
      an IntervalSet instance describing the sorted set of intervals where this function's value is less than the specified threshold

      Illustration:

    • discretized

      public PiecewiseFunction discretized(double step, PiecewiseFunction.InterpolationType interpolationType)
      Returns a discretized version of this PiecewiseFunction using a fixed discretization step. The resulting function is aligned to a uniform grid with the specified step, and its values match the original function exactly at every grid point.

      At every discretization grid point, for all discretization types: discretized.valueAt(t) == this.valueAt(t)

      Interpolation between grid points:

      • PiecewiseFunction.InterpolationType.STEP_AFTER The function is reconstructed as a right-continuous step function. On the interval [x, x + step), the value equals this.valueAt(t + step). This produces a staircase that preserves all sampled cumulative values at the end of each step.
      • PiecewiseFunction.InterpolationType.LINEAR A straight line is used over each interval [x, x + step). The slope is selected so that the line passes exactly through both grid points. The resulting function is a piecewise-linear approximation of the original one, constrained to match at all grid boundaries.
      Parameters:
      step - the discretization step size (must be positive and finite)
      interpolationType - the interpolation method between grid points
      Returns:
      A new PiecewiseFunction that is a discretized version of this PiecewiseFunction.
    • positiveStepChangesSum

      public double positiveStepChangesSum()
      Calculates the sum of positive step changes in this piecewise linear function.
      Returns:
      the sum of positive step changes in the function

      Illustration:

    • positiveStepChangesSum

      public double positiveStepChangesSum(Interval withinArgumentInterval)
      Calculates the sum of all positive step changes in this piecewise linear function within the specified argument interval.
      Parameters:
      withinArgumentInterval - the argument interval within which to calculate the sum of positive step changes
      Returns:
      the sum of positive step changes in the function

      Illustration:

    • negativeStepChangesSum

      public double negativeStepChangesSum()
      Calculates the sum of all absolute values of negative step changes in this piecewise linear function.
      Returns:
      sum of all absolute values of negative step changes in the function

      Illustration:

    • negativeStepChangesSum

      public double negativeStepChangesSum(Interval withinArgumentInterval)
      Calculates the sum of all absolute values of negative step changes in this piecewise linear function within the specified argument interval.
      Parameters:
      withinArgumentInterval - the argument interval within which to calculate the sum of absolute values of negative step changes
      Returns:
      sum of all absolute values of negative step changes in the function

      Illustration:

    • toCodeString

      public String toCodeString()
      Returns a Java code that creates a PiecewiseFunction equal to this one. Can be used, for example, for unit testing and debugging.
      Returns:
      string representing a Java code that creates a PiecewiseFunction equal to this one
    • isNonDecreasing

      public boolean isNonDecreasing()
      Checks whether this piecewise function is non-decreasing, i.e.:
      • it has no negative step changes, and
      • It has no segments with negative rate.
      Returns:
      true if the function is non-decreasing, false otherwise
    • isNonIncreasing

      public boolean isNonIncreasing()
      Checks whether this piecewise function is non-increasing, i.e.:
      • it has no positive step changes, and
      • It has no segments with positive rate.
      Returns:
      true if the function is non-increasing, false otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object