Package space.kscience.kmath.expressions

Types

AutoDiffProcessor
Link copied to clipboard
common
fun fun interface AutoDiffProcessor<T : Any, I : Any, A : ExpressionAlgebra<T, I>, out R : Expression<T>>
A factory that converts an expression in autodiff variables to a DifferentiableExpression
AutoDiffValue
Link copied to clipboard
common
open class AutoDiffValue<out T>(value: T)
DerivationResult
Link copied to clipboard
common
class DerivationResult<T : Any>(value: T, derivativeValues: Map<String, T>, context: Field<T>)
Represents result of simpleAutoDiff call.
DifferentiableExpression
Link copied to clipboard
common
interface DifferentiableExpression<T, out R : Expression<T>> : Expression<T>
Represents expression which structure can be differentiated.
Expression
Link copied to clipboard
common
fun fun interface Expression<T>
An elementary function that could be invoked on a map of arguments.
ExpressionAlgebra
Link copied to clipboard
common
interface ExpressionAlgebra<in T, E> : Algebra<E>
A context for expression construction
FirstDerivativeExpression
Link copied to clipboard
common
abstract class FirstDerivativeExpression<T, R : Expression<T>> : DifferentiableExpression<T, R>
A DifferentiableExpression that defines only first derivatives
FunctionalExpressionAlgebra
Link copied to clipboard
common
abstract class FunctionalExpressionAlgebra<T, A : Algebra<T>>(algebra: A) : ExpressionAlgebra<T, Expression<T>>
A context class for Expression construction.
FunctionalExpressionExtendedField
Link copied to clipboard
common
open class FunctionalExpressionExtendedField<T, A : ExtendedField<T>>(algebra: A) : FunctionalExpressionField<T, A> , ExtendedField<Expression<T>>
FunctionalExpressionField
Link copied to clipboard
common
open class FunctionalExpressionField<T, A : Field<T>>(algebra: A) : FunctionalExpressionRing<T, A> , Field<Expression<T>> , ScaleOperations<Expression<T>>
FunctionalExpressionGroup
Link copied to clipboard
common
open class FunctionalExpressionGroup<T, A : Group<T>>(algebra: A) : FunctionalExpressionAlgebra<T, A> , Group<Expression<T>>
A context class for Expression construction for Ring algebras.
FunctionalExpressionRing
Link copied to clipboard
common
open class FunctionalExpressionRing<T, A : Ring<T>>(algebra: A) : FunctionalExpressionGroup<T, A> , Ring<Expression<T>>
MST
Link copied to clipboard
common
sealed class MST
A Mathematical Syntax Tree (MST) node for mathematical expressions.
MstAlgebra
Link copied to clipboard
common
object MstAlgebra : NumericAlgebra<MST>
Algebra over MST nodes.
MstExtendedField
Link copied to clipboard
common
object MstExtendedField : ExtendedField<MST> , NumericAlgebra<MST>
ExtendedField over MST nodes.
MstField
Link copied to clipboard
common
object MstField : Field<MST> , NumbersAddOperations<MST> , ScaleOperations<MST>
Field over MST nodes.
MstGroup
Link copied to clipboard
common
object MstGroup : Group<MST> , NumericAlgebra<MST> , ScaleOperations<MST>
Group over MST nodes.
MstRing
Link copied to clipboard
common
object MstRing : Ring<MST> , NumbersAddOperations<MST> , ScaleOperations<MST>
Ring over MST nodes.
SimpleAutoDiffExpression
Link copied to clipboard
common
class SimpleAutoDiffExpression<T : Any, F : Field<T>>(field: F, function: SimpleAutoDiffField<T, F>.() -> AutoDiffValue<T>) : FirstDerivativeExpression<T, Expression<T>>
A constructs that creates a derivative structure with required order on-demand
SimpleAutoDiffExtendedField
Link copied to clipboard
common
class SimpleAutoDiffExtendedField<T : Any, F : ExtendedField<T>>(context: F, bindings: Map<Symbol, T>) : SimpleAutoDiffField<T, F> , ExtendedField<AutoDiffValue<T>> , ScaleOperations<AutoDiffValue<T>>
SimpleAutoDiffField
Link copied to clipboard
common
open class SimpleAutoDiffField<T : Any, F : Field<T>>(context: F, bindings: Map<Symbol, T>) : Field<AutoDiffValue<T>> , ExpressionAlgebra<T, AutoDiffValue<T>> , NumbersAddOperations<AutoDiffValue<T>>
Represents field in context of which functions can be derived.
SimpleSymbolIndexer
Link copied to clipboard
common
class SimpleSymbolIndexer(symbols: List<Symbol>) : SymbolIndexer
SymbolIndexer
Link copied to clipboard
common
interface SymbolIndexer
An environment to easy transform indexed variables to symbols and back.

Functions

acos
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.acos(x: AutoDiffValue<T>): AutoDiffValue<T>
acosh
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.acosh(x: AutoDiffValue<T>): AutoDiffValue<T>
asin
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.asin(x: AutoDiffValue<T>): AutoDiffValue<T>
asinh
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.asinh(x: AutoDiffValue<T>): AutoDiffValue<T>
atan
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.atan(x: AutoDiffValue<T>): AutoDiffValue<T>
atanh
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.atanh(x: AutoDiffValue<T>): AutoDiffValue<T>
binding
Link copied to clipboard
common
fun <T, E> ExpressionAlgebra<T, E>.binding(): ReadOnlyProperty<Any?, E>
Bind a symbol by name inside the ExpressionAlgebra
cos
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.cos(x: AutoDiffValue<T>): AutoDiffValue<T>
cosh
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.cosh(x: AutoDiffValue<T>): AutoDiffValue<T>
derivative
Link copied to clipboard
common
fun <T, R : Expression<T>> DifferentiableExpression<T, R>.derivative(vararg symbols: Symbol): R
fun <T, R : Expression<T>> DifferentiableExpression<T, R>.derivative(name: String): R
fun <T, R : Expression<T>> DifferentiableExpression<T, R>.derivative(symbols: List<Symbol>): R
evaluate
Link copied to clipboard
common
fun <T> Algebra<T>.evaluate(node: MST): T
Interprets the MST node with this Algebra.
exp
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.exp(x: AutoDiffValue<T>): AutoDiffValue<T>
expressionInExtendedField
Link copied to clipboard
common
inline fun <T, A : ExtendedField<T>> A.expressionInExtendedField(block: FunctionalExpressionExtendedField<T, A>.() -> Expression<T>): Expression<T>
expressionInField
Link copied to clipboard
common
inline fun <T, A : Field<T>> A.expressionInField(block: FunctionalExpressionField<T, A>.() -> Expression<T>): Expression<T>
expressionInRing
Link copied to clipboard
common
inline fun <T, A : Ring<T>> A.expressionInRing(block: FunctionalExpressionRing<T, A>.() -> Expression<T>): Expression<T>
expressionInSpace
Link copied to clipboard
common
inline fun <T, A : Ring<T>> A.expressionInSpace(block: FunctionalExpressionGroup<T, A>.() -> Expression<T>): Expression<T>
grad
Link copied to clipboard
common
fun <T : Any> DerivationResult<T>.grad(vararg variables: Symbol): Point<T>
Computes the gradient for variables in given order.
interpret
Link copied to clipboard
common
fun <T : Any> MST.interpret(algebra: Algebra<T>, vararg arguments: Pair<Symbol, T>): T
Interprets the MST node with this Algebra and optional arguments
fun <T : Any> MST.interpret(algebra: Algebra<T>, arguments: Map<Symbol, T>): T
Interprets the MST node with this Algebra and optional arguments
invoke
Link copied to clipboard
common
operator fun <T> Expression<T>.invoke(): T
Calls this expression without providing any arguments.
@JvmName(name = callByString)
operator fun <T> Expression<T>.invoke(vararg pairs: Pair<String, T>): T
Calls this expression from arguments.
@JvmName(name = callBySymbol)
operator fun <T> Expression<T>.invoke(vararg pairs: Pair<Symbol, T>): T
Calls this expression from arguments.
ln
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.ln(x: AutoDiffValue<T>): AutoDiffValue<T>
pow
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.pow(x: AutoDiffValue<T>, y: Double): AutoDiffValue<T>
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.pow(x: AutoDiffValue<T>, y: Int): AutoDiffValue<T>
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.pow(x: AutoDiffValue<T>, y: AutoDiffValue<T>): AutoDiffValue<T>
simpleAutoDiff
Link copied to clipboard
common
fun <T : Any, F : Field<T>> F.simpleAutoDiff(vararg bindings: Pair<Symbol, T>, body: SimpleAutoDiffField<T, F>.() -> AutoDiffValue<T>): DerivationResult<T>
fun <T : Any, F : Field<T>> F.simpleAutoDiff(bindings: Map<Symbol, T>, body: SimpleAutoDiffField<T, F>.() -> AutoDiffValue<T>): DerivationResult<T>
Runs differentiation and establishes SimpleAutoDiffField context inside the block of code.
sin
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.sin(x: AutoDiffValue<T>): AutoDiffValue<T>
sinh
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.sinh(x: AutoDiffValue<T>): AutoDiffValue<T>
sqr
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.sqr(x: AutoDiffValue<T>): AutoDiffValue<T>
sqrt
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.sqrt(x: AutoDiffValue<T>): AutoDiffValue<T>
tan
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.tan(x: AutoDiffValue<T>): AutoDiffValue<T>
tanh
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.tanh(x: AutoDiffValue<T>): AutoDiffValue<T>
toExpression
Link copied to clipboard
common
fun <T : Any> MST.toExpression(algebra: Algebra<T>): Expression<T>
Interpret this MST as expression.
withSymbols
Link copied to clipboard
common
inline fun <R> withSymbols(vararg symbols: Symbol, block: SymbolIndexer.() -> R): R
Execute the block with symbol indexer based on given symbol order
inline fun <R> withSymbols(symbols: Collection<Symbol>, block: SymbolIndexer.() -> R): R