class ConcatenatedFunction: UnivariateFunction

Represents the sequential concatenation of the provided member functions.

Fields

Name Description
val domain: Range<Double>

definable domain

Constructors

<init>

constructor(memberFunctions: List<UnivariateFunction>, absoluteDomains: List<Range<Double>>, absoluteStarts: List<Double>)

Represents the sequential concatenation of the provided member functions.

Parameters

Name Description
memberFunctions: List<UnivariateFunction>

functions to be concatenated

absoluteDomains: List<Range<Double>>
absoluteStarts: List<Double>

absolute start of the first function

Methods

valueInFuzzy

fun valueInFuzzy(x: Double, tolerance: Double): Result<Double, Exception>

Evaluation of z = f(x) with fuzzy checking whether x is within the function's domain.

Parameters

Name Description
x: Double

parameter x of function

tolerance: Double

allowed tolerance for fuzzy checking

ReturnValue

Name Description
Result<Double, Exception>

returns Result.Success(z) = f(x), if x is fuzzily contained in domain and evaluation was successful

equals

fun equals(other: Any?): Boolean

Parameters

Name Description
other: Any?

ReturnValue

Name Description
Boolean

hashCode

fun hashCode(): Int

ReturnValue

Name Description
Int

CompanionObject

ConcatenatedFunction

class ConcatenatedFunction: UnivariateFunction

Represents the sequential concatenation of the provided member functions.

Methods

ofLinearFunctions

fun ofLinearFunctions(starts: List<Double>, intercepts: List<Double>, prependConstant: Boolean, appendConstant: Boolean): UnivariateFunction

Creates a concatenated function of a list of linear functions, whereby the slopes are adjusted so that the concatenated function is continuous. For example: f(x) = slope_1 * x + 0 for [0, 5) f(x) = slope_2 * x - 5 for [5, ∞) The starts would be listOf(0, 5) and the intercepts would be listOf(0, -5).

Parameters

Name Description
starts: List<Double>

absolute start value of the function member

intercepts: List<Double>

local intercept of the linear function

prependConstant: Boolean

if true, the first linear function is preceded by a constant function

appendConstant: Boolean

if true, the last linear function is appended by a constant function

ReturnValue

Name Description
UnivariateFunction

ofPolynomialFunctions

fun ofPolynomialFunctions(starts: List<Double>, coefficients: List<DoubleArray>, prependConstant: Boolean, prependConstantValue: Double): UnivariateFunction

Creates a concatenated function with a list of polynomial function. For example: f(x) = 2 + 3x + 4x^2 + x^3 for [-2, 3) f(x) = 1 + 2x + 3x^2 + 4* x^3 for [3, ∞) The starts would be listOf(-2, 3) and the coefficients would be listOf(arrayOf(2, 3, 4, 1), arrayOf(1, 2, 3, 4)).

Parameters

Name Description
starts: List<Double>

absolute start value of the function member

coefficients: List<DoubleArray>

coefficients of the polynomial function members

prependConstant: Boolean

if true, the first linear function is preceded by a constant function

prependConstantValue: Double

ReturnValue

Name Description
UnivariateFunction