FunctionValueAttribute Class

Marks a parameter as writable function-value output storage or as a derivative provider's coefficient-construction destination.

Definition

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

Remarks

The differentiated source method may use the annotated storage to construct part or all of its function value. The current admitted source subset requires an ordinary by-value parameter with reference identity, used as writable result storage. Forward mode permits indexed readback and one initial root-level destination-preparation call assigning the parameter before any use. Returning that selected destination supplies a second physical transport of the same logical result. Incoming contents are irrelevant; locations must be initialized before readback. The generator owns the tangent shadow. General rebinding and Reverse mutable readback remain unsupported. Parameters passed with ref, out, or in are not currently supported.

Whether a generated derivative method also returns the primal function value depends on its requested AutoDiffResult contract and output plumbing. This attribute does not by itself establish nullable allocation or return behavior.

Length supplies optional static shape metadata to supported generation paths.

On a derivative provider, this attribute instead marks its sole coefficient construction destination. Such a provider returns void; the destination is excluded from primal input arity and receives fresh body-local storage with the differentiated array/vector input's runtime shape. Length metadata is optional. The provider author is responsible for result initialization and derivative correctness; the compiler preserves role binding, storage isolation, and ordinary write/read semantics.

Caller-provided writable function-value storage must not alias primal input storage whose values are needed by the differentiated computation, or another simultaneously writable output or workspace buffer, or concurrently observed storage, unless that aliasing pattern is explicitly documented as supported. The source generator does not insert runtime alias checks; violating this precondition is outside the supported contract.

Constructors

FunctionValueAttribute Initializes a new instance of the FunctionValueAttribute class.

Properties

Length Gets or sets an optional static element count for the output container. Omitting the named argument leaves the length unspecified to the source generator.
TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute)

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