PHP Класс NumPHP\Core\NumArray

С версии: 1.0.0
Автор: Gordon Lesti ([email protected])
Наследование: extends NumPHP\Core\Cache
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$data array | mixed The data of the NumArray
$shape array The shape of the NumArray

Открытые методы

Метод Описание
__construct ( mixed $data ) Creates an new NumArray
__toString ( ) : string Returns a string representing the NumArray
abs ( ) Applies abs on every value of the NumArray
add ( mixed $addend ) Adds an array, NumArray or numeric value to the existing NumArray
div ( mixed $divisor ) Divides the NumArray with a divisor
dot ( mixed $factor ) Multiplies an array, NumArray or numeric value to the existing NumArray
get ( ) : NumArray Returns a sliced part the NumArray
getData ( ) : mixed Returns the data of the NumArray
getNDim ( ) : integer Returns the number of axis (dimensions) the NumArray
getShape ( ) : array Returns the dimensions of the NumArray
getSize ( ) : integer Returns the number of elements the NumArray
getTranspose ( ) : NumArray Returns the transposed NumArray
max ( integer $axis = null ) : NumArray Returns the max of the NumArray for the given axis
mean ( integer $axis = null ) : NumArray Returns the mean of the NumArray for the given axis
min ( integer $axis = null ) : NumArray Returns the min of the NumArray for the given axis
mult ( mixed $factor ) Multiplies the NumArray with a factor
reshape ( ) : NumArray Reshapes the NumArray
set ( ) Replaces a value or complete parts in the NumArray. The new value is always the last argument
sub ( mixed $subtrahend ) Subtracts an array, NumArray or numeric value from the existing NumArray
sum ( integer $axis = null ) : NumArray Summed all elements of an NumArray for the given axis

Описание методов

__construct() публичный метод

Creates an new NumArray
С версии: 1.0.0
public __construct ( mixed $data )
$data mixed given data

__toString() публичный метод

Returns a string representing the NumArray
С версии: 1.0.0
public __toString ( ) : string
Результат string

abs() публичный метод

Applies abs on every value of the NumArray
С версии: 1.0.0
public abs ( )

add() публичный метод

Adds an array, NumArray or numeric value to the existing NumArray
С версии: 1.0.0
public add ( mixed $addend )
$addend mixed an other int, float, array or NumArray

div() публичный метод

Divides the NumArray with a divisor
С версии: 1.0.4
public div ( mixed $divisor )
$divisor mixed divisor

dot() публичный метод

Multiplies an array, NumArray or numeric value to the existing NumArray
С версии: 1.0.0
public dot ( mixed $factor )
$factor mixed an other int, float, array or NumArray

get() публичный метод

Returns a sliced part the NumArray
С версии: 1.0.0
public get ( ) : NumArray
Результат NumArray

getData() публичный метод

Returns the data of the NumArray
С версии: 1.0.0
public getData ( ) : mixed
Результат mixed

getNDim() публичный метод

Returns the number of axis (dimensions) the NumArray
С версии: 1.0.0
public getNDim ( ) : integer
Результат integer

getShape() публичный метод

Returns the dimensions of the NumArray
С версии: 1.0.0
public getShape ( ) : array
Результат array

getSize() публичный метод

Returns the number of elements the NumArray
С версии: 1.0.0
public getSize ( ) : integer
Результат integer

getTranspose() публичный метод

Returns the transposed NumArray
С версии: 1.0.0
public getTranspose ( ) : NumArray
Результат NumArray

max() публичный метод

Returns the max of the NumArray for the given axis
С версии: 1.0.0
public max ( integer $axis = null ) : NumArray
$axis integer given axis of max
Результат NumArray

mean() публичный метод

Returns the mean of the NumArray for the given axis
С версии: 1.0.0
public mean ( integer $axis = null ) : NumArray
$axis integer given axis of mean
Результат NumArray

min() публичный метод

Returns the min of the NumArray for the given axis
С версии: 1.0.0
public min ( integer $axis = null ) : NumArray
$axis integer given axis of min
Результат NumArray

mult() публичный метод

Multiplies the NumArray with a factor
С версии: 1.0.4
public mult ( mixed $factor )
$factor mixed factor

reshape() публичный метод

Reshapes the NumArray
С версии: 1.0.0
public reshape ( ) : NumArray
Результат NumArray

set() публичный метод

Replaces a value or complete parts in the NumArray. The new value is always the last argument
С версии: 1.0.0
public set ( )

sub() публичный метод

Subtracts an array, NumArray or numeric value from the existing NumArray
С версии: 1.0.0
public sub ( mixed $subtrahend )
$subtrahend mixed an other int, float, array or NumArray

sum() публичный метод

Summed all elements of an NumArray for the given axis
С версии: 1.0.0
public sum ( integer $axis = null ) : NumArray
$axis integer given axis of sum
Результат NumArray

Описание свойств

$data защищенное свойство

The data of the NumArray
protected array|mixed $data
Результат array | mixed

$shape защищенное свойство

The shape of the NumArray
protected array $shape
Результат array