PrimalReturnValueAttribute Class

Supplies an already-computed CLR return value of the primal function as context to a derivative provider.

Definition

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

Remarks

The source generator currently supports this attribute on the sole by-value parameter of a local function with parameterless or named DerivativeAttribute, declared directly in a static or instance method. The primal projection must expose a unique whole CLR return transport, and this parameter's represented type must match that transport. Other logical outputs may coexist. A primal without a CLR return cannot supply this context. It is not a selector for arbitrary logical outputs.

This context does not add a semantic primal input, change the primal codomain, or cause the primal computation to be repeated. It is not writable derivative-result storage. Unlike FunctionValueAttribute, it does not identify storage through which a source method constructs an output. PrimalValueAttribute remains primal-input shape metadata.

Current coefficient-provider body/result restrictions remain in effect. Shared rules substitute the contextual output's element type together with the primal inputs. A static top-level two-string derivative provider may mark at most one by-value parameter with this attribute. It is excluded from semantic arity and input indices and cannot be the named differentiation target. Its type must match the target projection's CLR return transport, independently of the coefficient return type. Top-level providers bind to an existing target implementation projection when available. Provider-only publication retains the legacy scalar model, requiring the same scalar input, result, and context; the provider does not invent a target contract. See DerivativeAttribute for the supported boundary.

Constructors

PrimalReturnValueAttribute Initializes a new instance of the PrimalReturnValueAttribute class.

Properties

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