Package org.djutils.math.functions
Class Concatenation
java.lang.Object
org.djutils.math.functions.Concatenation
- All Implemented Interfaces:
 Comparable<MathFunction>,Function<Double,,Double> MathFunction
Concatenate FunctionInterface objects
 
Copyright (c) 2024-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.
- Author:
 - Alexander Verbraeck, Peter Knoppers, Wouter Schakel
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumThe various discontinuities reported by thediscontinuitiesmethod.Nested classes/interfaces inherited from interface org.djutils.math.functions.MathFunction
MathFunction.TupleSt - 
Constructor Summary
ConstructorsConstructorDescriptionConstruct a Concatenation from a sorted set of Interval<MathFunction>.Concatenation(Interval<MathFunction>... intervals) Construct the concatenation of one or more MathFunction objects. - 
Method Summary
Modifier and TypeMethodDescriptionintcompareWithinSubType(MathFunction other) Determine sorting order among instances of a particular sub type ofMathFunction.static ConcatenationcontinuousPiecewiseLinear(double... arguments) Construct a concatenation that is piecewise linear through a given set of input-output pairs.static ConcatenationConstruct a concatenation that is piecewise linear through a given set of points.discontinuities(Interval<?> interval) Report all non-continuities and all points wherethisfunction is non differentiable, or non-evaluable.booleanReturns the derivative of the data with respect to fractional length.getKnotReport(Interval<?> interval) Report what is known about knots of thisMathFunctionin someInterval.Report all knots of thisMathFunctionin someInterval.inthashCode()scaleBy(double factor) Incorporate a multiplication factor to this MathFunction.intSorting priority of this type of MathFunction (low values shall sort before higher).toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djutils.math.functions.MathFunction
compareChains, compareTo, getScale, mergeAdd, mergeDivide, mergeMultiply, printValue, simplify 
- 
Constructor Details
- 
Concatenation
Construct the concatenation of one or more MathFunction objects.- Parameters:
 intervals- the functions and the domains over which they should be active
 - 
Concatenation
Construct a Concatenation from a sorted set of Interval<MathFunction>.- Parameters:
 set- the sorted set of Interval with MathFunction payload
 
 - 
 - 
Method Details
- 
apply
 - 
getDerivative
Description copied from interface:MathFunctionReturns the derivative of the data with respect to fractional length.- Specified by:
 getDerivativein interfaceMathFunction- Returns:
 - derivative of this MathFunction
 
 - 
scaleBy
Description copied from interface:MathFunctionIncorporate a multiplication factor to this MathFunction.- Specified by:
 scaleByin interfaceMathFunction- Parameters:
 factor- the factor to incorporate- Returns:
 - a new MathFunction that yields the same result as the original function multiplied by the 
factor 
 - 
sortPriority
public int sortPriority()Description copied from interface:MathFunctionSorting priority of this type of MathFunction (low values shall sort before higher).- Specified by:
 sortPriorityin interfaceMathFunction- Returns:
 - sorting priority of this type of MathFunction
 
 - 
continuousPiecewiseLinear
Construct a concatenation that is piecewise linear through a given set of points.- Parameters:
 map- mapping from domain to value at the inflection points- Returns:
 - new Concatenation that is piecewise linear and connects the given points
 - Throws:
 IllegalArgumentException- whenmapcontains fewer than 2 entries
 - 
continuousPiecewiseLinear
Construct a concatenation that is piecewise linear through a given set of input-output pairs.- Parameters:
 arguments- the input-output pairs; these specify the inflection points- Returns:
 - new Concatenation that is piecewise linear and connects the given points
 - Throws:
 IllegalArgumentException- whenargumentscontains an odd number of entries, or fewer than 2 domain values, or duplicate domain values with differing function values
 - 
compareWithinSubType
Description copied from interface:MathFunctionDetermine sorting order among instances of a particular sub type ofMathFunction. The sorting order should sortMathFunctions that may be combined next to one another. BecauseMathFunctions are also used inSortedSets, this comparator may return 0 if and only if this and other are entirely equal!- Specified by:
 compareWithinSubTypein interfaceMathFunction- Parameters:
 other- the otherMathFunctionthat must be of the same type- Returns:
 - int; < 0 when this sorts before other; > 0 when this sorts after other; 0 when this and other are identical
 
 - 
discontinuities
Report all non-continuities and all points wherethisfunction is non differentiable, or non-evaluable. If anotherMathFunctionis chained, the transformation of that function, nor any discontinuities of thatMathFunctionare taken into account as there is (currently) no way to figure out what values of the domain of the chained function result in values that correspond to the discontinuities ofthisfunction.- Parameters:
 interval- the interval on which to report the discontinuities- Returns:
 - iterator that will generate all discontinuities in the interval
 
 - 
getKnotReport
Description copied from interface:MathFunctionReport what is known about knots of thisMathFunctionin someInterval. The report does not take chained functions into account.- Specified by:
 getKnotReportin interfaceMathFunction- Parameters:
 interval- theIntervalon which knowledge of knots is requested- Returns:
 - summary of what is known about knots in the Interval
 
 - 
getKnots
Description copied from interface:MathFunctionReport all knots of thisMathFunctionin someInterval. ThrowsIllegalStateExceptionwhen the number of knots in theIntervalis not known, or infinite.- Specified by:
 getKnotsin interfaceMathFunction- Parameters:
 interval- theIntervalover which the knots must be reported- Returns:
 - all the knots of this 
MathFunctionin the requestedInterval 
 - 
toString
 - 
hashCode
public int hashCode() - 
equals
 
 -