Table of Contents

Interface INDArrayCarrier

Namespace
NumSharp
Assembly
NumSharp.dll

Opt-in seam a tuple-standin result struct (np.UniqueResult, np.MeshgridResult, PolyfitResult, …) implements so the NDScopedAttribute weaver can weave a boundary method that RETURNS it: YieldTo(NDScope) hands every NDArray the struct carries back to the ambient scope (via Returns<T>(T)), so the method's temporaries are reclaimed while its results survive.

public interface INDArrayCarrier

Remarks

Implemented EXPLICITLY (the member stays off the struct's public API); the weaver calls it through a boxing-free constrained call at each return. The members are yielded from INSIDE the struct rather than decomposed by the weaver because a struct's own method can read its private fields (auto-property backing fields, _grids, …) while the enclosing type's woven method cannot — the CLR grants nested→enclosing private access, not the reverse. A carrier struct WITHOUT this interface reports build error NDW003 and must be hand-scoped. PUBLIC because the opt-in is consumer-facing too: a project that installs the NumSharp.Build package implements it on its own result structs so its NDScopedAttribute methods can return them (and the woven cross-assembly YieldTo call must pass the CLR's accessibility check).

Methods

YieldTo(NDScope)

Yields every NDArray this carrier holds into scope.

void YieldTo(NDScope scope)

Parameters

scope NDScope