DerivationResult

class DerivationResult<T : Any>(value: T, derivativeValues: Map<String, T>, context: Field<T>)

Represents result of simpleAutoDiff call.

Parameters

T

the non-nullable type of value.

value

the value of result.

Constructors

DerivationResult
Link copied to clipboard
common
fun <T : Any> DerivationResult(value: T, derivativeValues: Map<String, T>, context: Field<T>)
the non-nullable type of value.

Functions

derivative
Link copied to clipboard
common
fun derivative(variable: Symbol): T
Returns derivative of variable or returns Ring.zero in context.
div
Link copied to clipboard
common
fun div(): T
Computes the divergence.
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
toString
Link copied to clipboard
common
open fun toString(): String

Properties

context
Link copied to clipboard
common
val context: Field<T>
The field over T.
value
Link copied to clipboard
common
val value: T
the value of result.

Extensions

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.