trait ArithmeticTrait (View source)

Methods

static 
reciprocal(NdArray|array|float|int $m)

Return the reciprocal of the argument, element-wise.

static 
subtract(NdArray|array|float|int $m, NdArray|array|float|int $n)

Subtract a matrix from matrix

static NdArray|int|float
add(NdArray|array|int|float $m, NdArray|array|int|float $n)

Add two array_like

static NdArray|float|int
divide(NdArray|array|float|int $m, NdArray|array|float|int $n)

Divide two arrays, element-wise

static NdArray|float|int
multiply(NdArray|array|float|int $m, NdArray|array|float|int $n)

Multiply two arrays, element-wise

static NdArray|float|int
dot(NdArray|array|float|int $m, NdArray|array|float|int $n)

Dot product of two arrays

static callable
rowDot(NdArray $m, NdArray $n)

Browse p rows

static callable
colDot($row_m, NdArray $m, NdArray $n)

Browse p cols and sum products

Details

final static reciprocal(NdArray|array|float|int $m)

Return the reciprocal of the argument, element-wise.

Parameters

NdArray|array|float|int $m

final static subtract(NdArray|array|float|int $m, NdArray|array|float|int $n)

Subtract a matrix from matrix

Parameters

NdArray|array|float|int $m
NdArray|array|float|int $n

final static NdArray|int|float add(NdArray|array|int|float $m, NdArray|array|int|float $n)

Add two array_like

Parameters

NdArray|array|int|float $m
NdArray|array|int|float $n

Return Value

NdArray|int|float

final static NdArray|float|int divide(NdArray|array|float|int $m, NdArray|array|float|int $n)

Divide two arrays, element-wise

Parameters

NdArray|array|float|int $m A 2-dim array.
NdArray|array|float|int $n A 2-dim array.

Return Value

NdArray|float|int

Exceptions

InvalidArgumentException

final static NdArray|float|int multiply(NdArray|array|float|int $m, NdArray|array|float|int $n)

Multiply two arrays, element-wise

Parameters

NdArray|array|float|int $m A 2-dim array.
NdArray|array|float|int $n A 2-dim array.

Return Value

NdArray|float|int

Exceptions

InvalidArgumentException

final static NdArray|float|int dot(NdArray|array|float|int $m, NdArray|array|float|int $n)

Dot product of two arrays

Parameters

NdArray|array|float|int $m A 2-dim array.
NdArray|array|float|int $n A 2-dim array.

Return Value

NdArray|float|int

Exceptions

InvalidArgumentException

final static protected callable rowDot(NdArray $m, NdArray $n)

Browse p rows

Parameters

NdArray $m
NdArray $n

Return Value

callable

final static protected callable colDot($row_m, NdArray $m, NdArray $n)

Browse p cols and sum products

Parameters

$row_m
NdArray $m
NdArray $n

Return Value

callable