PHP Class Phpml\Math\Matrix

Show file Open project: php-ai/php-ml Class Usage Examples

Public Methods

Method Description
__construct ( array $matrix, boolean $validate = true )
crossOut ( integer $row, integer $column ) : Matrix
divideByScalar ( $value ) : Matrix
fromFlatArray ( array $array ) : Matrix
getColumnValues ( $column ) : array
getColumns ( ) : integer
getDeterminant ( ) : float | integer
getRows ( ) : integer
inverse ( ) : Matrix
isSquare ( ) : boolean
multiply ( Matrix $matrix ) : Matrix
toArray ( ) : array
transpose ( ) : Matrix

Private Methods

Method Description
calculateDeterminant ( ) : float | integer

Method Details

__construct() public method

public __construct ( array $matrix, boolean $validate = true )
$matrix array
$validate boolean

crossOut() public method

public crossOut ( integer $row, integer $column ) : Matrix
$row integer
$column integer
return Matrix

divideByScalar() public method

public divideByScalar ( $value ) : Matrix
$value
return Matrix

fromFlatArray() public static method

public static fromFlatArray ( array $array ) : Matrix
$array array
return Matrix

getColumnValues() public method

public getColumnValues ( $column ) : array
$column
return array

getColumns() public method

public getColumns ( ) : integer
return integer

getDeterminant() public method

public getDeterminant ( ) : float | integer
return float | integer

getRows() public method

public getRows ( ) : integer
return integer

inverse() public method

public inverse ( ) : Matrix
return Matrix

isSquare() public method

public isSquare ( ) : boolean
return boolean

multiply() public method

public multiply ( Matrix $matrix ) : Matrix
$matrix Matrix
return Matrix

toArray() public method

public toArray ( ) : array
return array

transpose() public method

public transpose ( ) : Matrix
return Matrix