# NDWasmArray

NDWasmArray

## Constructor

#### new NDWasmArray(buffer, shape, dtype)

Source:
  - ndwasmarray.js, line 14

##### Parameters:

Name | Type | Description
--- | --- | ---
`buffer` | WasmBuffer | The WASM memory bridge (contains .ptr and .view).
`shape` | Int32Array | Array | Dimensions of the array.
`dtype` | string | Data type (e.g., 'float64').

### Classes

NDWasmArray

### Methods

#### dispose()

Description:

  - Manually releases WASM heap memory.

Source:
  - ndwasmarray.js, line 101

#### matmul(other) → {NDWasmArray}

Description:

  - Matrix Multiplication: C = this * other

Source:
  - ndwasmarray.js, line 127

##### Parameters:

Name | Type | Description
--- | --- | ---
`other` | NDWasmArray | NDArray |

##### Returns:

Type
  NDWasmArray

#### matmulBatch(other) → {NDWasmArray}

Description:

  - Batched Matrix Multiplication: C[i] = this[i] * other[i]

Source:
  - ndwasmarray.js, line 162

##### Parameters:

Name | Type | Description
--- | --- | ---
`other` | NDWasmArray | NDArray |

##### Returns:

Type
  NDWasmArray

#### pull(disposeopt)

Description:

  - Pulls data from WASM to a JS-managed NDArray.

Source:
  - ndwasmarray.js, line 88

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`dispose` | boolean | <optional> | `true` | Release WASM memory after pulling.

#### (static) fromArray()

Description:

  - Static factory: Creates a WASM-resident array.

    1. If source is an NDArray, it calls .push() to move it to WASM.
    2. If source is a JS Array, it allocates WASM memory and fills it directly via recursive traversal to avoid intermediate flattening.
Source:
  - ndwasmarray.js, line 34