# Global

##

### Members

#### (constant) DTYPE_MAP

Description:

  - The TypedArray map

Source:
  - ndarray_core.js, line 20

The TypedArray map

### Methods

#### abs(x) → {NDArray}

Description:

  - Absolute value.

Source:
  - ndarray_helpers.js, line 230
See:
  - {NDArray#abs}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### add(l, r) → {NDArray}

Description:

  - Element-wise addition. Supports broadcasting.

Source:
  - ndarray_helpers.js, line 14
See:
  - {NDArray#add}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### arange(start, stop, stepopt, dtypeopt) → {NDArray}

Description:

  - Like Python's arange: [start, stop)

Source:
  - ndarray_factory.js, line 182

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`start` | number |  |  | the starting value of the sequence.
`stop` | number | null |  |  | the end value of the sequence.
`step` | number | null | <optional> | `1` | the spacing between values.
`dtype` | string | <optional> | `'float64'` | the data type of the resulting array.

##### Returns:

Type
  NDArray

#### argwhere(condition) → {NDArray}

Description:

  - argwhere(condition)

Source:
  - ndarray_factory.js, line 225

##### Parameters:

Name | Type | Description
--- | --- | ---
`condition` | NDArray | Array | number | Input array to check for non-zero elements.

##### Returns:

A new contiguous NDArray with shape[nz, condition.ndim], where nz is the number of non-zero elements in condition. Each row contains the indices of a non-zero element in condition.

Type
  NDArray

#### array(source, dtypeopt) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 10

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`source` | Array | TypedArray |  |  | The source data.
`dtype` | string | <optional> | `'float64'` | The desired data type.

##### Returns:

Type
  NDArray

#### bitwise_and(l, r) → {NDArray}

Description:

  - Bitwise AND.

Source:
  - ndarray_helpers.js, line 118
See:
  - {NDArray#bitwise_and}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### bitwise_lshift(l, r) → {NDArray}

Description:

  - Bitwise left shift.

Source:
  - ndarray_helpers.js, line 169
See:
  - {NDArray#bitwise_lshift}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### bitwise_not(x) → {NDArray}

Description:

  - Bitwise NOT.

Source:
  - ndarray_helpers.js, line 202
See:
  - {NDArray#bitwise_not}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### bitwise_or(l, r) → {NDArray}

Description:

  - Bitwise OR.

Source:
  - ndarray_helpers.js, line 135
See:
  - {NDArray#bitwise_or}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### bitwise_rshift(l, r) → {NDArray}

Description:

  - Bitwise (logical) right shift.

Source:
  - ndarray_helpers.js, line 186
See:
  - {NDArray#bitwise_rshift}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### bitwise_xor(l, r) → {NDArray}

Description:

  - Bitwise XOR.

Source:
  - ndarray_helpers.js, line 152
See:
  - {NDArray#bitwise_xor}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### ceil(x) → {NDArray}

Description:

  - Ceiling (round up).

Source:
  - ndarray_helpers.js, line 321
See:
  - {NDArray#ceil}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### concat(arrays, axisopt) → {NDArray}

Description:

  - Joins a sequence of arrays along an existing axis.

Source:
  - ndarray_factory.js, line 400

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`arrays` | Array.<NDArray> |  |  | The arrays must have the same shape, except in the dimension corresponding to `axis`.
`axis` | number | <optional> | `0` | The axis along which the arrays will be joined.

##### Returns:

A new NDArray.

Type
  NDArray

#### cos(x) → {NDArray}

Description:

  - Cosine.

Source:
  - ndarray_helpers.js, line 282
See:
  - {NDArray#cos}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### cross(l, r) → {NDArray#cross}

Description:

  - Cross Product

Source:
  - ndarray_helpers.js, line 377

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray |

##### Returns:

Type
  NDArray#cross

#### div(l, r) → {NDArray}

Description:

  - Element-wise division. Supports broadcasting.

Source:
  - ndarray_helpers.js, line 65
See:
  - {NDArray#div}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### dot(l, r) → {NDArray}

Description:

  - Dot Product

Source:
  - ndarray_helpers.js, line 361
See:
  - {NDArray#dot}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### exp(x) → {NDArray}

Description:

  - Exponential function (e^x).

Source:
  - ndarray_helpers.js, line 243
See:
  - {NDArray#exp}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### eye(n, mopt, dtypeopt) → {NDArray}

Description:

  - Creates a 2D identity matrix.

Source:
  - ndarray_factory.js, line 549

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`n` | number |  |  | Number of rows.
`m` | number | <optional> |  | Number of columns. Defaults to n if not provided.
`dtype` | string | <optional> | `'float64'` | Data type of the array.

##### Returns:

A 2D NDArray with ones on the main diagonal.

Type
  NDArray

#### float32(source) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 77

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | Array | TypedArray | The source data.

##### Returns:

Type
  NDArray

#### float64(source) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 69

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | Array | TypedArray | The source data.

##### Returns:

Type
  NDArray

#### floor(x) → {NDArray}

Description:

  - Floor (round down).

Source:
  - ndarray_helpers.js, line 334
See:
  - {NDArray#floor}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### fromWasm(bridge, shape, dtypeopt) → {NDArray}

Description:

  - Static factory: Creates a new NDArray directly from WASM computation results.

Source:
  - ndwasm.js, line 181

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`bridge` | WasmBuffer |  | The WasmBuffer instance containing the result from WASM.
`shape` | Array.<number> |  | The shape of the new NDArray.
`dtype` | string | <optional> | The data type of the new NDArray. If not provided, uses bridge.dtype.

##### Returns:

The new NDArray.

Type
  NDArray

#### full(shape, value, dtypeopt) → {NDArray}

Description:

  - Creates a new NDArray of the given shape, filled with a specified value.

Source:
  - ndarray_factory.js, line 168

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`shape` | Array.<number> |  |  | The shape of the new array.
`value` | * |  |  | The value to fill the array with.
`dtype` | string | <optional> | `'float64'` | The data type of the new array.

##### Returns:

Type
  NDArray

#### int16(source) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 101

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | Array | TypedArray | The source data.

##### Returns:

Type
  NDArray

#### int32(source) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 93

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | Array | TypedArray | The source data.

##### Returns:

Type
  NDArray

#### int8(source) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 117

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | Array | TypedArray | The source data.

##### Returns:

Type
  NDArray

#### linspace(start, stop, numopt, dtypeopt) → {NDArray}

Description:

  - Linearly spaced points.

Source:
  - ndarray_factory.js, line 204

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`start` | number |  |  | the starting value of the sequence.
`stop` | number | null |  |  | the end value of the sequence.
`num` | number | <optional> | `50` | the number of samples to generate.
`dtype` | string | <optional> | `'float64'` | the data type of the resulting array.

##### Returns:

Type
  NDArray

#### log(x) → {NDArray}

Description:

  - Natural logarithm (base e).

Source:
  - ndarray_helpers.js, line 308
See:
  - {NDArray#log}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### mod(l, r) → {NDArray}

Description:

  - Element-wise modulo. Supports broadcasting.

Source:
  - ndarray_helpers.js, line 99
See:
  - {NDArray#mod}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### mul(l, r) → {NDArray}

Description:

  - Element-wise multiplication. Supports broadcasting.

Source:
  - ndarray_helpers.js, line 48
See:
  - {NDArray#mul}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### neg(x) → {NDArray}

Description:

  - Numeric negation.

Source:
  - ndarray_helpers.js, line 217
See:
  - {NDArray#neg}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### ones(shape, dtypeopt) → {NDArray}

Description:

  - Creates a new NDArray of the given shape, filled with ones.

Source:
  - ndarray_factory.js, line 155

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`shape` | Array.<number> |  |  | The shape of the new array.
`dtype` | string | <optional> | `'float64'` | The data type of the new array.

##### Returns:

Type
  NDArray

#### pow(l, r) → {NDArray}

Description:

  - Element-wise exponentiation. Supports broadcasting.

Source:
  - ndarray_helpers.js, line 82
See:
  - {NDArray#pow}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### round(x) → {NDArray}

Description:

  - Round to nearest integer.

Source:
  - ndarray_helpers.js, line 347
See:
  - {NDArray#round}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### sin(x) → {NDArray}

Description:

  - Sine.

Source:
  - ndarray_helpers.js, line 269
See:
  - {NDArray#sin}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### sqrt(x) → {NDArray}

Description:

  - Square root.

Source:
  - ndarray_helpers.js, line 256
See:
  - {NDArray#sqrt}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### stack(arrays, axisopt) → {NDArray}

Description:

  - Joins a sequence of arrays along a new axis. The `stack` function creates a new dimension, whereas `concat` joins along an existing one. All input arrays must have the same shape and dtype.

Source:
  - ndarray_factory.js, line 476

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`arrays` | Array.<NDArray> |  |  | The list of arrays to stack.
`axis` | number | <optional> | `0` | The axis in the result array along which the input arrays are stacked.

##### Returns:

A new NDArray.

Type
  NDArray

#### sub(l, r) → {NDArray}

Description:

  - Element-wise subtraction. Supports broadcasting.

Source:
  - ndarray_helpers.js, line 31
See:
  - {NDArray#sub}

##### Parameters:

Name | Type | Description
--- | --- | ---
`l` | Array | TypedArray |
`r` | Array | TypedArray | number |

##### Returns:

Type
  NDArray

#### tan(x) → {NDArray}

Description:

  - Tangent.

Source:
  - ndarray_helpers.js, line 295
See:
  - {NDArray#tan}

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | Array | TypedArray |

##### Returns:

Type
  NDArray

#### uint16(source) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 109

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | Array | TypedArray | The source data.

##### Returns:

Type
  NDArray

#### uint32(source) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 85

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | Array | TypedArray | The source data.

##### Returns:

Type
  NDArray

#### uint8(source) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 125

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | Array | TypedArray | The source data.

##### Returns:

Type
  NDArray

#### uint8c(source) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 133

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | Array | TypedArray | The source data.

##### Returns:

Type
  NDArray

#### where(condition, x, y) → {NDArray}

Description:

  - where(condition, x, y) Returns a new array with elements chosen from x or y depending on condition. Supports NumPy-style broadcasting across all three arguments, including 0-sized dimensions.

Source:
  - ndarray_factory.js, line 266

##### Parameters:

Name | Type | Description
--- | --- | ---
`condition` | NDArray | Array | number | Where True, yield x, otherwise yield y.
`x` | NDArray | Array | number | Values from which to choose if condition is True.
`y` | NDArray | Array | number | Values from which to choose if condition is False.

##### Returns:

A new contiguous NDArray.

Type
  NDArray

#### zeros(shape, dtypeopt) → {NDArray}

Description:

  - Creates a new NDArray of the given shape, filled with zeros.

Source:
  - ndarray_factory.js, line 143

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`shape` | Array.<number> |  |  | The shape of the new array.
`dtype` | string | <optional> | `'float64'` | The data type of the new array.

##### Returns:

Type
  NDArray