Global

Members

(constant) DTYPE_MAP

Description:
  • The TypedArray map

Source:

The TypedArray map

Methods

abs(x) → {NDArray}

Description:
  • Absolute value.

Source:
See:
Parameters:
Name Type Description
x Array | TypedArray
Returns:
Type
NDArray

add(l, r) → {NDArray}

Description:
  • Element-wise addition. Supports broadcasting.

Source:
See:
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:
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:
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:
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:
See:
Parameters:
Name Type Description
l Array | TypedArray
r Array | TypedArray | number
Returns:
Type
NDArray

bitwise_lshift(l, r) → {NDArray}

Description:
  • Bitwise left shift.

Source:
See:
Parameters:
Name Type Description
l Array | TypedArray
r Array | TypedArray | number
Returns:
Type
NDArray

bitwise_not(x) → {NDArray}

Description:
  • Bitwise NOT.

Source:
See:
Parameters:
Name Type Description
x Array | TypedArray
Returns:
Type
NDArray

bitwise_or(l, r) → {NDArray}

Description:
  • Bitwise OR.

Source:
See:
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:
See:
Parameters:
Name Type Description
l Array | TypedArray
r Array | TypedArray | number
Returns:
Type
NDArray

bitwise_xor(l, r) → {NDArray}

Description:
  • Bitwise XOR.

Source:
See:
Parameters:
Name Type Description
l Array | TypedArray
r Array | TypedArray | number
Returns:
Type
NDArray

ceil(x) → {NDArray}

Description:
  • Ceiling (round up).

Source:
See:
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:
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:
See:
Parameters:
Name Type Description
x Array | TypedArray
Returns:
Type
NDArray

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

Description:
  • Cross Product

Source:
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:
See:
Parameters:
Name Type Description
l Array | TypedArray
r Array | TypedArray | number
Returns:
Type
NDArray

dot(l, r) → {NDArray}

Description:
  • Dot Product

Source:
See:
Parameters:
Name Type Description
l Array | TypedArray
r Array | TypedArray
Returns:
Type
NDArray

exp(x) → {NDArray}

Description:
  • Exponential function (e^x).

Source:
See:
Parameters:
Name Type Description
x Array | TypedArray
Returns:
Type
NDArray

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

Description:
  • Creates a 2D identity matrix.

Source:
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:
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:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

floor(x) → {NDArray}

Description:
  • Floor (round down).

Source:
See:
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:
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:
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:
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:
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:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

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

Description:
  • Linearly spaced points.

Source:
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:
See:
Parameters:
Name Type Description
x Array | TypedArray
Returns:
Type
NDArray

mod(l, r) → {NDArray}

Description:
  • Element-wise modulo. Supports broadcasting.

Source:
See:
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:
See:
Parameters:
Name Type Description
l Array | TypedArray
r Array | TypedArray | number
Returns:
Type
NDArray

neg(x) → {NDArray}

Description:
  • Numeric negation.

Source:
See:
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:
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:
See:
Parameters:
Name Type Description
l Array | TypedArray
r Array | TypedArray | number
Returns:
Type
NDArray

round(x) → {NDArray}

Description:
  • Round to nearest integer.

Source:
See:
Parameters:
Name Type Description
x Array | TypedArray
Returns:
Type
NDArray

sin(x) → {NDArray}

Description:
  • Sine.

Source:
See:
Parameters:
Name Type Description
x Array | TypedArray
Returns:
Type
NDArray

sqrt(x) → {NDArray}

Description:
  • Square root.

Source:
See:
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:
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:
See:
Parameters:
Name Type Description
l Array | TypedArray
r Array | TypedArray | number
Returns:
Type
NDArray

tan(x) → {NDArray}

Description:
  • Tangent.

Source:
See:
Parameters:
Name Type Description
x Array | TypedArray
Returns:
Type
NDArray

uint16(source) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
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:
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:
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:
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:
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:
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