Internals Reference
This part of the developer documentation exclusively refers to internals that may change without warning in a future release of SparseConnectivityTracer. Anything written on this page should be treated as if it was undocumented. Only functionality that is exported or part of the user documentation adheres to semantic versioning.
SparseConnectivityTracer.AbstractTracer
SparseConnectivityTracer.Dual
SparseConnectivityTracer.GradientTracer
SparseConnectivityTracer.HessianTracer
SparseConnectivityTracer.NotShared
SparseConnectivityTracer.Shared
SparseConnectivityTracer.TracerLocalSparsityDetector
SparseConnectivityTracer.TracerSparsityDetector
ADTypes.hessian_sparsity
ADTypes.jacobian_sparsity
SparseConnectivityTracer.gradient
SparseConnectivityTracer.hessian
SparseConnectivityTracer.hessian_buffer
SparseConnectivityTracer.hessian_eltype
SparseConnectivityTracer.jacobian_buffer
SparseConnectivityTracer.jacobian_eltype
SparseConnectivityTracer.myempty
SparseConnectivityTracer.shared
Tracer Types
SparseConnectivityTracer.AbstractTracer
— TypeAbstractTracer
Abstract supertype of tracers.
Type hierarchy
AbstractTracer
├── GradientTracer
└── HessianTracer
Note that Dual
is not an AbstractTracer
.
SparseConnectivityTracer.GradientTracer
— Typestruct GradientTracer{I<:Integer, G<:AbstractSet{I<:Integer}} <: SparseConnectivityTracer.AbstractTracer
Real
number type keeping track of non-zero gradient entries.
Fields
gradient::AbstractSet{I} where I<:Integer
: Set of indices $i$ of non-zero values $∇f(x)_i ≠ 0$ in the gradient.isempty::Bool
: Indicator whether gradient in tracer contains only zeros.
SparseConnectivityTracer.HessianTracer
— Typestruct HessianTracer{I<:Integer, G<:AbstractSet{I<:Integer}, H<:Union{AbstractDict{I<:Integer, G<:AbstractSet{I<:Integer}}, AbstractSet{Tuple{I<:Integer, I<:Integer}}}, S<:SparseConnectivityTracer.SharingBehavior} <: SparseConnectivityTracer.AbstractTracer
Real
number type keeping track of non-zero gradient and Hessian entries.
Fields
gradient::AbstractSet{I} where I<:Integer
: Set of indices $i$ of non-zero values $∇f(x)_i ≠ 0$ in the gradient.hessian::Union{AbstractDict{I, G}, AbstractSet{Tuple{I, I}}} where {I<:Integer, G<:AbstractSet{I}}
: Set of index-tuples $(i, j)$ of non-zero values $∇²f(x)_{ij} ≠ 0$ in the Hessian.isempty::Bool
: Indicator whether gradient and Hessian in tracer both contain only zeros.
SparseConnectivityTracer.Dual
— Typestruct Dual{P<:Real, T<:SparseConnectivityTracer.AbstractTracer} <: Real
Dual Real
number type keeping track of the results of a primal computation as well as a tracer.
Fields
primal::Real
tracer::SparseConnectivityTracer.AbstractTracer
Traits
SparseConnectivityTracer.NotShared
— TypeIndicates that patterns can share memory and operators are prohibited from mutating HessianTracer
arguments. In practice, memory sharing is limited to second-order information in HessianTracer
.
SparseConnectivityTracer.Shared
— TypeIndicates that patterns always share memory and that operators are allowed to mutate their HessianTracer
arguments. In practice, memory sharing is limited to second-order information in HessianTracer
.
SparseConnectivityTracer.shared
— Functionshared(pattern)
Indicates whether patterns always share memory and whether operators are allowed to mutate their HessianTracer
arguments. Returns either the Shared()
or NotShared()
trait.
If NotShared()
, patterns can share memory and operators are prohibited from mutating HessianTracer
arguments.
Note
In practice, memory sharing is limited to second-order information in HessianTracer
.
Utilities
SparseConnectivityTracer.gradient
— Functiongradient(pattern::AbstractTracer)
Return a representation of non-zero values $∇f(x)_{i} ≠ 0$ in the gradient.
SparseConnectivityTracer.hessian
— Functionhessian(pattern::HessianTracer)
Return a representation of non-zero values $∇²f(x)_{ij} ≠ 0$ in the Hessian.
SparseConnectivityTracer.myempty
— Functionmyempty(T)
myempty(tracer::AbstractTracer)
Constructor for an empty tracer or pattern of type T
representing a new number (usually an empty pattern).