PHP Class NumPHP\Core\NumArray

Since: 1.0.0
Author: Gordon Lesti ([email protected])
Inheritance: extends NumPHP\Core\Cache
Afficher le fichier Open project: numphp/numphp Class Usage Examples

Protected Properties

Свойство Type Description
$data array | mixed The data of the NumArray
$shape array The shape of the NumArray

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

Creates an new NumArray
Since: 1.0.0
public __construct ( mixed $data )
$data mixed given data

__toString() public méthode

Returns a string representing the NumArray
Since: 1.0.0
public __toString ( ) : string
Résultat string

abs() public méthode

Applies abs on every value of the NumArray
Since: 1.0.0
public abs ( )

add() public méthode

Adds an array, NumArray or numeric value to the existing NumArray
Since: 1.0.0
public add ( mixed $addend )
$addend mixed an other int, float, array or NumArray

div() public méthode

Divides the NumArray with a divisor
Since: 1.0.4
public div ( mixed $divisor )
$divisor mixed divisor

dot() public méthode

Multiplies an array, NumArray or numeric value to the existing NumArray
Since: 1.0.0
public dot ( mixed $factor )
$factor mixed an other int, float, array or NumArray

get() public méthode

Returns a sliced part the NumArray
Since: 1.0.0
public get ( ) : NumArray
Résultat NumArray

getData() public méthode

Returns the data of the NumArray
Since: 1.0.0
public getData ( ) : mixed
Résultat mixed

getNDim() public méthode

Returns the number of axis (dimensions) the NumArray
Since: 1.0.0
public getNDim ( ) : integer
Résultat integer

getShape() public méthode

Returns the dimensions of the NumArray
Since: 1.0.0
public getShape ( ) : array
Résultat array

getSize() public méthode

Returns the number of elements the NumArray
Since: 1.0.0
public getSize ( ) : integer
Résultat integer

getTranspose() public méthode

Returns the transposed NumArray
Since: 1.0.0
public getTranspose ( ) : NumArray
Résultat NumArray

max() public méthode

Returns the max of the NumArray for the given axis
Since: 1.0.0
public max ( integer $axis = null ) : NumArray
$axis integer given axis of max
Résultat NumArray

mean() public méthode

Returns the mean of the NumArray for the given axis
Since: 1.0.0
public mean ( integer $axis = null ) : NumArray
$axis integer given axis of mean
Résultat NumArray

min() public méthode

Returns the min of the NumArray for the given axis
Since: 1.0.0
public min ( integer $axis = null ) : NumArray
$axis integer given axis of min
Résultat NumArray

mult() public méthode

Multiplies the NumArray with a factor
Since: 1.0.4
public mult ( mixed $factor )
$factor mixed factor

reshape() public méthode

Reshapes the NumArray
Since: 1.0.0
public reshape ( ) : NumArray
Résultat NumArray

set() public méthode

Replaces a value or complete parts in the NumArray. The new value is always the last argument
Since: 1.0.0
public set ( )

sub() public méthode

Subtracts an array, NumArray or numeric value from the existing NumArray
Since: 1.0.0
public sub ( mixed $subtrahend )
$subtrahend mixed an other int, float, array or NumArray

sum() public méthode

Summed all elements of an NumArray for the given axis
Since: 1.0.0
public sum ( integer $axis = null ) : NumArray
$axis integer given axis of sum
Résultat NumArray

Property Details

$data protected_oe property

The data of the NumArray
protected array|mixed $data
Résultat array | mixed

$shape protected_oe property

The shape of the NumArray
protected array $shape
Résultat array