Decorator
abstract class Decorator implements ArrayAccess, IndexInterface (View source)
Multiple inheritance for NdArray
Traits
Properties
| protected array | $data | from AttributeTrait |
Methods
Gets the dimensions of the array
Get values from an element or a range
Assign values to an element or a range
Execute axis operations and return an aggregate
Call a np function
Return the reciprocal of the argument, element-wise. {@link http://sciphp.org/ndarray.reciprocal}
Sum along diagonals {@link http://sciphp.org/ndarray.trace}.
Generate a Vandermonde matrix. {@link http://sciphp.org/ndarray.vander}
Returns element-wise true where signbit is set (less than zero). {@link http://sciphp.org/ndarray.signbit}
Natural logarithm, element-wise. {@link http://sciphp.org/ndarray.log}
Is current matrix a square matrix. {@link http://sciphp.org/ndarray.is_square}
Calculate exp(x) - 1 for all elements in the array. {@link http://sciphp.org/ndarray.expm1}
Matrix elements raised to powers. {@link http://sciphp.org/ndarray.power}
The non-negative square-root of an array, element-wise. {@link http://sciphp.org/ndarray.sqrt}
Integrate along the given axis using the composite trapezoidal rule. {@link http://sciphp.org/ndarray.trapz}
Sum all elements. {@link http://sciphp.org/ndarray.sum}
Subtract input from matrix. {@link http://sciphp.org/ndarray.subtract}
Multiply matrix by a given input, element-wise. {@link http://sciphp.org/ndarray.multiply}
Change the sign to that of given matrix, element-wise. {@link http://sciphp.org/ndarray.copysign}
Details
final NdArray
add(NdArray|array|float|int $input)
Add a matrix or a number
final void
__set(string $name, mixed $value)
Attribute setter
final int|array|NdArray
__get(string $name)
Generic getter
final protected int
getSize()
Get the total number of elements of the array
final protected array
getShape(int|float|array $data, array $shape)
Gets the dimensions of the array
final NdArray
copy()
Create a copy
final mixed
offsetGet(string|int $index)
Get a view by index
final NdArray
offsetSet(int|string $index, int|string $value)
Set a view by index
final protected int|float|array
filterGet(array $filter, int $index, array|null $data = null)
Get values from an element or a range
final protected void
filterSet(array $filter, int $index, array|null $data = null, int|float $value = null)
Assign values to an element or a range
final protected array
indexFilter(array $matches)
Prepare filter values
final protected array
filterRange(array $filter, int $index, int $count)
Get range definition
final bool
offsetUnset(mixed $offset)
Remove a portion of the data array
final bool
offsetExists(mixed $offset)
Check that an index is defined
final NdArray
ravel()
Flattens data array
final NdArray
resize()
Resize array
final NdArray
reshape()
Reshapes data
final NdArray
walk(callable $func)
Walk on first dimension
final NdArray
walk_recursive(callable $func)
Walk on last dimension
final int|float
iterate(RecursiveIteratorIterator $iterator)
Iterate on next value
final int|NdArray
axis(callable $func, int|float $number = null, bool $keepdims = false)
Execute axis operations and return an aggregate
final mixed
__call(string $name, array|null $arguments = null)
Call a np function
NdArray
reciprocal()
Return the reciprocal of the argument, element-wise. {@link http://sciphp.org/ndarray.reciprocal}
int|float|array
trace(int $k)
Sum along diagonals {@link http://sciphp.org/ndarray.trace}.
NdArray
tril(int $k)
Lower triangle of an array {@link http://sciphp.org/ndarray.tril}
NdArray
triu(int $k)
Upper triangle of an array {@link http://sciphp.org/ndarray.triu}
NdArray
vander(int $num = null)
Generate a Vandermonde matrix. {@link http://sciphp.org/ndarray.vander}
NdArray
signbit()
Returns element-wise true where signbit is set (less than zero). {@link http://sciphp.org/ndarray.signbit}
NdArray
log(int|float $base = M_E)
Natural logarithm, element-wise. {@link http://sciphp.org/ndarray.log}
NdArray
log10()
Base-10 logarithm, element-wise. {@link http://sciphp.org/ndarray.log10}
NdArray
log2()
Base-2 logarithm, element-wise. {@link http://sciphp.org/ndarray.log2}
NdArray
negative()
Numerical negative, element-wise. {@link http://sciphp.org/ndarray.negative}
bool
is_square()
Is current matrix a square matrix. {@link http://sciphp.org/ndarray.is_square}
NdArray
expm1()
Calculate exp(x) - 1 for all elements in the array. {@link http://sciphp.org/ndarray.expm1}
NdArray
exp2()
Calculate 2**p for all p in the input array. {@link http://sciphp.org/ndarray.exp2}
NdArray
power(float|int $exponent)
Matrix elements raised to powers. {@link http://sciphp.org/ndarray.power}
NdArray
square()
The element-wise square of the input. {@link http://sciphp.org/ndarray.square}
NdArray
sqrt()
The non-negative square-root of an array, element-wise. {@link http://sciphp.org/ndarray.sqrt}
int|float|array
trapz()
Integrate along the given axis using the composite trapezoidal rule. {@link http://sciphp.org/ndarray.trapz}
NdArray
sum(int|null $axis, bool $keepdims)
Sum all elements. {@link http://sciphp.org/ndarray.sum}
NdArray
subtract(NdArray|array|float|int $input)
Subtract input from matrix. {@link http://sciphp.org/ndarray.subtract}
NdArray
multiply(NdArray|array|float|int $input)
Multiply matrix by a given input, element-wise. {@link http://sciphp.org/ndarray.multiply}
NdArray
copysign(NdArray|array|float|int $m)
Change the sign to that of given matrix, element-wise. {@link http://sciphp.org/ndarray.copysign}
NdArray
cos()
Cosine element-wise. {@link http://sciphp.org/ndarray.cos}
NdArray
sin()
Trigonometric sine, element-wise. {@link http://sciphp.org/ndarray.sin}
NdArray
tan()
Compute tangent element-wise. {@link http://sciphp.org/ndarray.tan}
NdArray
transform()
Transform a PHP array in a NdArray if needed