PHP Class NumPHP\Core\NumPHP

Since: 1.0.0
Author: Gordon Lesti ([email protected])
Datei anzeigen Open project: numphp/numphp Class Usage Examples

Public Methods

Method Description
arange ( float $low, float $high, float $step = 1 ) : NumArray Creates a vector (NumArray) from $low to $high with $step steps
eye ( integer $mAxis, integer $nAxis ) : NumArray Returns a matrix (NumArray) filled with 0 and 1 on the main diagonal
identity ( integer $mAxis ) : NumArray Returns a identity matrix (NumArray) filled with 0 and 1 on the main diagonal
linspace ( float $low, float $high, integer $number ) : NumArray Creates a vector (NumArray) from $low to $high with the size of $number
ones ( ) : NumArray Returns a NumArray filled with 1
onesLike ( NumArray $numArray ) : NumArray Returns a NumArray with the same size, but filled with 1
rand ( ) : NumArray Returns a NumArray filled with random values
randLike ( NumArray $numArray ) : NumArray Returns a NumArray with the same size, but filled with random values
zeros ( ) : NumArray Returns a NumArray filled with 0
zerosLike ( NumArray $numArray ) : NumArray Returns a NumArray with the same size, but filled with 0

Method Details

arange() public static method

Creates a vector (NumArray) from $low to $high with $step steps
Since: 1.0.0
public static arange ( float $low, float $high, float $step = 1 ) : NumArray
$low float beginning of the vector
$high float end of the vector
$step float steps, if not given `$step` = `1.0`
return NumArray

eye() public static method

Returns a matrix (NumArray) filled with 0 and 1 on the main diagonal
Since: 1.0.0
public static eye ( integer $mAxis, integer $nAxis ) : NumArray
$mAxis integer size of the m axis
$nAxis integer size of the n axis, if not given `$nAxis` = `$mAxis`
return NumArray

identity() public static method

Returns a identity matrix (NumArray) filled with 0 and 1 on the main diagonal
Since: 1.0.0
public static identity ( integer $mAxis ) : NumArray
$mAxis integer size of the m axis and n axis
return NumArray

linspace() public static method

Creates a vector (NumArray) from $low to $high with the size of $number
Since: 1.0.0
public static linspace ( float $low, float $high, integer $number ) : NumArray
$low float beginning of the vector
$high float end of the vector
$number integer size of the vector
return NumArray

ones() public static method

Returns a NumArray filled with 1
Since: 1.0.0
public static ones ( ) : NumArray
return NumArray

onesLike() public static method

Returns a NumArray with the same size, but filled with 1
Since: 1.0.0
public static onesLike ( NumArray $numArray ) : NumArray
$numArray NumArray given NumArray
return NumArray

rand() public static method

Returns a NumArray filled with random values
Since: 1.0.0
public static rand ( ) : NumArray
return NumArray

randLike() public static method

Returns a NumArray with the same size, but filled with random values
Since: 1.0.0
public static randLike ( NumArray $numArray ) : NumArray
$numArray NumArray given NumArray
return NumArray

zeros() public static method

Returns a NumArray filled with 0
Since: 1.0.0
public static zeros ( ) : NumArray
return NumArray

zerosLike() public static method

Returns a NumArray with the same size, but filled with 0
Since: 1.0.0
public static zerosLike ( NumArray $numArray ) : NumArray
$numArray NumArray given NumArray
return NumArray