Class MinMaxNode
public sealed class MinMaxNode : NDExpr
- Inheritance
-
MinMaxNode
- Inherited Members
Constructors
MinMaxNode(bool, NDExpr, NDExpr)
Builds an np.minimum / np.maximum node: NaN-propagating, and for complex128 NumPy's CLE / CGE
selection (a tie keeps left). Prefer the Min(NDExpr, NDExpr) / Max(NDExpr, NDExpr)
factories; this is what they call.
public MinMaxNode(bool isMin, NDExpr left, NDExpr right)
Parameters
isMinboolTrue for np.minimum, false for np.maximum.
leftNDExprThe first operand (
x1).rightNDExprThe second operand (
x2).
Exceptions
- ArgumentNullException
leftorrightis null.
Properties
SupportsSimd
True if this node and its entire sub-tree have a SIMD emit path. Structural and type-independent — prefer SupportsSimdAt(NPTypeCode) for the compile decision, since some ops only vectorize at certain element types/runtimes.
public override bool SupportsSimd { get; }
Property Value
Methods
AppendSignature(StringBuilder)
Appends this node's structural signature, the kernel-cache key component: Min(..) / Max(..), or
ClipMin(..) / ClipMax(..) for a clip half, so a complex Clip(NDExpr, NDExpr, NDExpr) and the
equivalent-looking Min(Max(x, lo), hi) never share a compiled kernel.
public override void AppendSignature(StringBuilder sb)
Parameters
sbStringBuilderThe builder the signature is appended to.
EmitScalar(ILGenerator, NDExprCompileContext)
Emits the per-element body: both children converted to this node's dtype, then the engine's own scalar clamp (EmitScalarClamp(ILGenerator, NPTypeCode, bool, bool, bool)), the body its maximum / minimum ufuncs and np.clip's kernels run, so fused and unfused results agree bit for bit.
public override void EmitScalar(ILGenerator il, NDExprCompileContext ctx)
Parameters
ilILGeneratorThe kernel's IL stream; one value of this node's dtype is left on its stack.
ctxNDExprCompileContextThe compile context holding the per-node dtypes.
Exceptions
- NotSupportedException
The node's dtype is not one of the 15 element dtypes.
EmitVector(ILGenerator, NDExprCompileContext)
Emit vector code. On exit, the evaluation stack must have exactly
one Vector{W}<T> of element type ctx.OutputType.
Called only when SupportsSimd is true and all input
types equal the output type.
public override void EmitVector(ILGenerator il, NDExprCompileContext ctx)
Parameters
ilILGeneratorctxNDExprCompileContext