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.AbstractTracerSparseConnectivityTracer.DualSparseConnectivityTracer.GradientTracerSparseConnectivityTracer.HessianTracerSparseConnectivityTracer.NotSharedSparseConnectivityTracer.SharedSparseConnectivityTracer.TracerLocalSparsityDetectorSparseConnectivityTracer.TracerSparsityDetectorADTypes.hessian_sparsityADTypes.jacobian_sparsitySparseConnectivityTracer.gradientSparseConnectivityTracer.hessianSparseConnectivityTracer.hessian_bufferSparseConnectivityTracer.hessian_eltypeSparseConnectivityTracer.jacobian_bufferSparseConnectivityTracer.jacobian_eltypeSparseConnectivityTracer.myemptySparseConnectivityTracer.shared
Tracer Types
SparseConnectivityTracer.AbstractTracer — TypeAbstractTracerAbstract supertype of tracers.
Type hierarchy
AbstractTracer
├── GradientTracer
└── HessianTracerNote that Dual is not an AbstractTracer.
SparseConnectivityTracer.GradientTracer — Typestruct GradientTracer{I<:Integer, G<:AbstractSet{I<:Integer}} <: SparseConnectivityTracer.AbstractTracerReal 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.AbstractTracerReal 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} <: RealDual Real number type keeping track of the results of a primal computation as well as a tracer.
Fields
primal::Realtracer::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).