Table of Contents

Struct np.MGridResult

Namespace
NumSharp
Assembly
NumSharp.dll

The result of an mgrid index expression: a dense mesh — one array. NumPy's mgrid is a single ndarray (a 1-D array for one slice; a stacked (N, *sizes) array for several), and the idiom X, Y = np.mgrid[…] works by iterating that array's first axis. This value carries the array and reproduces both spellings: it converts implicitly to the bare NDArray, and it Deconstructs (var (x, y) = np.mgrid["0:5", "0:3"];) or indexes ([k]) into the per-axis grids along that first axis.

public readonly struct np.MGridResult : INDArrayCarrier
Implements
Inherited Members

Properties

Grid

The dense grid array — a 1-D array for one slice, else the stacked (N, *sizes).

public NDArray Grid { get; }

Property Value

NDArray

this[int]

The k-th per-axis grid — grid[k] along the first axis.

public NDArray this[int index] { get; }

Parameters

index int

Property Value

NDArray

Length

The number of per-axis grids stacked along the first axis (0 for a scalar/empty grid).

public int Length { get; }

Property Value

int

Methods

Deconstruct(out NDArray, out NDArray)

Deconstructs a two-axis grid: var (x, y) = np.mgrid["0:5", "0:3"];

public void Deconstruct(out NDArray item1, out NDArray item2)

Parameters

item1 NDArray
item2 NDArray

Deconstruct(out NDArray, out NDArray, out NDArray)

Deconstructs a three-axis grid.

public void Deconstruct(out NDArray item1, out NDArray item2, out NDArray item3)

Parameters

item1 NDArray
item2 NDArray
item3 NDArray

Deconstruct(out NDArray, out NDArray, out NDArray, out NDArray)

Deconstructs a four-axis grid.

public void Deconstruct(out NDArray item1, out NDArray item2, out NDArray item3, out NDArray item4)

Parameters

item1 NDArray
item2 NDArray
item3 NDArray
item4 NDArray

Operators

implicit operator NDArray(MGridResult)

Yields the whole dense grid — the array NumPy's mgrid[…] returns.

public static implicit operator NDArray(np.MGridResult result)

Parameters

result np.MGridResult

Returns

NDArray