NumArrayTrait
trait NumArrayTrait (View source)
Methods
Construct a n-dim array with a default value
Construct a new array of nulls with the same shape and type as a given array.
Construct a new array of zeros with the same shape and type as a given array.
Details
final static NdArray
zeros()
Creates a NdArray with zero as default value
final static NdArray
ones()
Creates a NdArray with one as default value
final static NdArray
nulls()
Creates a NdArray with null as default value 'empty' can not be used in PHP
final static NdArray
full(array $shape, mixed $value)
Creates a NdArray with a default value
final static protected mixed|array
createArray(array $params, mixed $value)
Construct a n-dim array with a default value
final static NdArray
nulls_like(array|NdArray $matrix)
Construct a new array of nulls with the same shape and type as a given array.
final static NdArray
zeros_like(array|NdArray $matrix)
Construct a new array of zeros with the same shape and type as a given array.
final static NdArray
ones_like(array|NdArray $matrix)
Construct a new array of ones with the same shape and type as a given array.
final static NdArray
full_like(array|NdArray $matrix, $value = null)
Construct a new array with the same shape and type as a given array, filled with a given value