kumulant

VectorExpr

@Serializable
sealed interface VectorExpr(source)

Wire-serialisable AST for vector-valued expressions over the same input environment as ScalarExpr / BoolExpr. Used by the spec-side transformVector(VectorExpr) operator when the output is a fresh vector rather than a per-element transform.

Output length need not match input length; use VectorExpr for permutations, dimensionality changes, pooling, feature augmentation. For same-length per-element transforms the simpler transformElement(ScalarExpr) is more direct and pays no extra allocation.

See ScalarExpr for the input-environment convention.

Functions

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

Evaluate this expression to produce a fresh DoubleArray from the per-update inputs. Concrete implementations choose the output length; downstream transformVector(VectorExpr) propagates it as the new vector dimensionality.

eval

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

Evaluate this expression to produce a fresh DoubleArray from the per-update inputs. Concrete implementations choose the output length; downstream transformVector(VectorExpr) propagates it as the new vector dimensionality.