SimpleAutoDiffField

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.

Constructors

SimpleAutoDiffField
Link copied to clipboard
common
fun <T : Any, F : Field<T>> SimpleAutoDiffField(context: F, bindings: Map<Symbol, T>)

Functions

add
Link copied to clipboard
common
open override fun add(a: AutoDiffValue<T>, b: AutoDiffValue<T>): AutoDiffValue<T>
Addition of two elements.
binaryOperation
Link copied to clipboard
common
open fun binaryOperation(operation: String, left: AutoDiffValue<T>, right: AutoDiffValue<T>): AutoDiffValue<T>
Dynamically invokes a binary operation with the certain name.
binaryOperationFunction
Link copied to clipboard
common
open override fun binaryOperationFunction(operation: String): (left: AutoDiffValue<T>, right: AutoDiffValue<T>) -> AutoDiffValue<T>
Dynamically dispatches a binary operation with the certain name.
bindSymbol
Link copied to clipboard
common
open fun bindSymbol(value: String): AutoDiffValue<T>
The same as bindSymbolOrNull but throws an error if symbol could not be bound
bindSymbolOrNull
Link copied to clipboard
common
open override fun bindSymbolOrNull(value: String): AutoDiffValue<T>?
Wraps a raw string to T object.
const
Link copied to clipboard
common
open override fun const(value: T): AutoDiffValue<T>
A constant expression that does not depend on arguments.
derive
Link copied to clipboard
common
fun <R> derive(value: R, block: F.(R) -> Unit): R
Performs update of derivative after the rest of the formula in the back-pass.
div
Link copied to clipboard
common
open operator fun AutoDiffValue<T>.div(b: AutoDiffValue<T>): AutoDiffValue<T>
Division of two elements.
open operator fun AutoDiffValue<T>.div(k: Number): AutoDiffValue<T>
Division of this element by scalar.
divide
Link copied to clipboard
common
open override fun divide(a: AutoDiffValue<T>, b: AutoDiffValue<T>): AutoDiffValue<T>
Division of two elements.
leftSideNumberOperation
Link copied to clipboard
common
open fun leftSideNumberOperation(operation: String, left: Number, right: AutoDiffValue<T>): AutoDiffValue<T>
Dynamically invokes a binary operation with the certain name with numeric first argument.
leftSideNumberOperationFunction
Link copied to clipboard
common
open fun leftSideNumberOperationFunction(operation: String): (left: Number, right: AutoDiffValue<T>) -> AutoDiffValue<T>
Dynamically dispatches a binary operation with the certain name with numeric first argument.
minus
Link copied to clipboard
common
open operator fun AutoDiffValue<T>.minus(b: AutoDiffValue<T>): AutoDiffValue<T>
Subtraction of two elements.
open operator fun Number.minus(b: AutoDiffValue<T>): AutoDiffValue<T>
Subtraction of number from element.
open operator fun AutoDiffValue<T>.minus(b: Number): AutoDiffValue<T>
Subtraction of element from number.
multiply
Link copied to clipboard
common
open override fun multiply(a: AutoDiffValue<T>, b: AutoDiffValue<T>): AutoDiffValue<T>
Multiplies two elements.
number
Link copied to clipboard
common
open override fun number(value: Number): AutoDiffValue<T>
Wraps a number to T object.
plus
Link copied to clipboard
common
open operator fun AutoDiffValue<T>.plus(b: AutoDiffValue<T>): AutoDiffValue<T>
Addition of two elements.
open operator fun Number.plus(b: AutoDiffValue<T>): AutoDiffValue<T>
Addition of scalar and element.
open operator fun AutoDiffValue<T>.plus(b: Number): AutoDiffValue<T>
Addition of element and scalar.
rightSideNumberOperation
Link copied to clipboard
common
open fun rightSideNumberOperation(operation: String, left: AutoDiffValue<T>, right: Number): AutoDiffValue<T>
Dynamically invokes a binary operation with the certain name with numeric second argument.
rightSideNumberOperationFunction
Link copied to clipboard
common
open fun rightSideNumberOperationFunction(operation: String): (left: AutoDiffValue<T>, right: Number) -> AutoDiffValue<T>
Dynamically dispatches a binary operation with the certain name with numeric first argument.
scale
Link copied to clipboard
common
open override fun scale(a: AutoDiffValue<T>, value: Double): AutoDiffValue<T>
Scaling an element by a scalar.
times
Link copied to clipboard
common
open operator fun AutoDiffValue<T>.times(b: AutoDiffValue<T>): AutoDiffValue<T>
Multiplies this element by scalar.
open operator fun Number.times(b: AutoDiffValue<T>): AutoDiffValue<T>
Multiplication of this number by element.
open operator fun AutoDiffValue<T>.times(k: Number): AutoDiffValue<T>
Multiplication of this element by a scalar.
unaryMinus
Link copied to clipboard
common
open operator override fun AutoDiffValue<T>.unaryMinus(): AutoDiffValue<T>
The negation of this element.
unaryOperation
Link copied to clipboard
common
open fun unaryOperation(operation: String, arg: AutoDiffValue<T>): AutoDiffValue<T>
Dynamically invokes a unary operation with the certain name.
unaryOperationFunction
Link copied to clipboard
common
open override fun unaryOperationFunction(operation: String): (arg: AutoDiffValue<T>) -> AutoDiffValue<T>
Dynamically dispatches a unary operation with the certain name.
unaryPlus
Link copied to clipboard
common
open operator fun AutoDiffValue<T>.unaryPlus(): AutoDiffValue<T>
Returns this value.

Properties

context
Link copied to clipboard
common
val context: F
d
Link copied to clipboard
common
var AutoDiffValue<T>.d: T
A variable accessing inner state of derivatives.
one
Link copied to clipboard
common
open override val one: AutoDiffValue<T>
The neutral element of multiplication
zero
Link copied to clipboard
common
open override val zero: AutoDiffValue<T>
The neutral element of addition.

Inheritors

SimpleAutoDiffExtendedField
Link copied to clipboard

Extensions

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>
const
Link copied to clipboard
common
inline fun <T : Any, F : Field<T>> SimpleAutoDiffField<T, F>.const(block: F.() -> T): AutoDiffValue<T>
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>
exp
Link copied to clipboard
common
fun <T : Any, F : ExtendedField<T>> SimpleAutoDiffField<T, F>.exp(x: AutoDiffValue<T>): AutoDiffValue<T>
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>
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>

Sources

common source
Link copied to clipboard