AutoDiffAttribute Class

Marks a method for automatic differentiation.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.10.0
C#
public sealed class AutoDiffAttribute : Attribute
Inheritance
Object  →  Attribute  →  AutoDiffAttribute

Remarks

Apply this attribute to a supported method to request generated first-order derivative code.

You can control which variables are differentiated (see the Variable, Variables and ArgumentPosition properties), choose a supported first-order result, and customize caller-provided derivative output buffers. Use TargetName to override the default generated method name, or NameSuffix to customize it.

Forward, reverse, result, source-shape, and method-host support is limited to the source generator's documented V1 subset.

Constructors

AutoDiffAttributeInitializes a new instance of the AutoDiffAttribute class

Properties

AllowNullArrayArguments Gets or sets whether caller-provided derivative output arguments may be null and allocated by generated code on supported paths.
ArgumentPosition Gets or sets the zero-based parameter position with respect to which differentiation is requested. This selector is mutually exclusive with Variables and Variable.
Ignore Gets or sets whether source generation is skipped for this attribute.
Mode Gets or sets the differentiation mode. Automatic, Forward, and Reverse are accepted for compatible first-order tasks.
NameSuffix A suffix to append to the original method name if TargetName is not provided. The default depends on the requested Result.
Result Gets or sets the requested first-order result.
ReturnArraysInArguments

Gets or sets whether supported non-scalar derivative result buffers are supplied as caller arguments rather than only returned.

TargetName Gets or sets the generated method name.
TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute)
Variable Gets or sets one parameter or supported member name with respect to which differentiation is requested.
Variables Gets or sets the names of parameters or supported members with respect to which differentiation is requested.

Methods

EqualsReturns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute)
GetHashCodeReturns the hash code for this instance.
(Inherited from Attribute)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Inherited from Attribute)
MatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Inherited from Attribute)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also