kumulant

IfExpr

@Serializable
@SerialName(value = "IfExpr")
data class IfExpr(val cond: BoolExpr, val then: ScalarExpr, val otherwise: ScalarExpr) : ScalarExpr(source)

Wire spec for a ternary if (cond) then else otherwise.

Constructors

Link copied to clipboard
constructor(cond: BoolExpr, then: ScalarExpr, otherwise: ScalarExpr)

Properties

Link copied to clipboard

Boolean predicate selecting the branch.

Link copied to clipboard

Branch returned when cond is false.

Link copied to clipboard

Branch returned when cond is true.

Functions

Link copied to clipboard
operator fun ScalarExpr.div(rhs: ScalarExpr): ScalarExpr

Build Div of two expressions.

operator fun ScalarExpr.div(rhs: Double): ScalarExpr

Divide this expression by a literal rhs.

Link copied to clipboard
infix fun ScalarExpr.eq(rhs: ScalarExpr): BoolExpr

Exact equality (no tolerance).

infix fun ScalarExpr.eq(rhs: Double): BoolExpr

Exact equality against a literal (no tolerance).

Link copied to clipboard
open override fun eval(x: Double, y: Double = 0.0, v: DoubleArray = EMPTY_VECTOR, primary: Result? = null): Double

Evaluate this expression against the per-update inputs. See the class KDoc for the input-environment convention.

Link copied to clipboard
infix fun ScalarExpr.ge(rhs: ScalarExpr): BoolExpr

Greater-or-equal comparison.

infix fun ScalarExpr.ge(rhs: Double): BoolExpr

Greater-or-equal against a literal.

Link copied to clipboard
infix fun ScalarExpr.gt(rhs: ScalarExpr): BoolExpr

Strictly-greater-than comparison.

infix fun ScalarExpr.gt(rhs: Double): BoolExpr

Strictly-greater-than against a literal.

Link copied to clipboard
infix fun ScalarExpr.le(rhs: ScalarExpr): BoolExpr

Less-or-equal comparison.

infix fun ScalarExpr.le(rhs: Double): BoolExpr

Less-or-equal against a literal.

Link copied to clipboard
infix fun ScalarExpr.lt(rhs: ScalarExpr): BoolExpr

Strictly-less-than comparison.

infix fun ScalarExpr.lt(rhs: Double): BoolExpr

Strictly-less-than against a literal.

Link copied to clipboard

Build Sub of two expressions.

operator fun ScalarExpr.minus(rhs: Double): ScalarExpr

Subtract a literal rhs from this expression.

Link copied to clipboard
operator fun ScalarExpr.plus(rhs: ScalarExpr): ScalarExpr

Build Add of two expressions.

operator fun ScalarExpr.plus(rhs: Double): ScalarExpr

Add a literal rhs to this expression.

Link copied to clipboard

Build Mul of two expressions.

operator fun ScalarExpr.times(rhs: Double): ScalarExpr

Multiply this expression by a literal rhs.

Link copied to clipboard

Unary minus: wraps in Neg.

IfExpr

constructor(cond: BoolExpr, then: ScalarExpr, otherwise: ScalarExpr)(source)

cond

Boolean predicate selecting the branch.

eval

open override fun eval(x: Double, y: Double = 0.0, v: DoubleArray = EMPTY_VECTOR, primary: Result? = null): Double(source)

Evaluate this expression against the per-update inputs. See the class KDoc for the input-environment convention.

otherwise

Branch returned when cond is false.

then

Branch returned when cond is true.