PHP Class MCordingley\LinearAlgebra\Matrix

Afficher le fichier Open project: mcordingley/linearalgebra Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( array $literal ) Example: $transform = new Matrix([ [0, 1, 2], [3, 4, 5], [6, 7, 8] ]);
addMatrix ( self $value ) : self
addScalar ( float $value ) : self
adjugate ( ) : self
concatenateBottom ( self $other ) : self
concatenateRight ( self $other ) : self
determinant ( ) : float
diagonal ( ) : self
entrywise ( self $value ) : self
equals ( Matrix $matrix ) : boolean
get ( integer $row, integer $column ) : float
getColumnCount ( ) : integer
getRowCount ( ) : integer
identity ( integer $size ) : self
inverse ( ) : self
isSquare ( ) : boolean
lower ( boolean $unitriangular ) : self
map ( callable $callback ) : self Iterates over the current matrix with a callback function to return a new matrix with the mapped values. $callback takes four arguments: - The current matrix element - The current row - The current column - The matrix being iterated over
multiplyMatrix ( self $value ) : self
multiplyScalar ( float $value ) : self
sliceColumns ( integer $offset, integer $length = null ) : self
sliceRows ( integer $offset, integer $length = null ) : self
spliceColumns ( integer $offset, integer $length = null, array $replacement = null ) : self
spliceRows ( integer $offset, integer $length = null, array $replacement = null ) : self
subtractMatrix ( self $value ) : self
subtractScalar ( float $value ) : self
toArray ( ) : array
trace ( ) : float
transpose ( ) : self
upper ( boolean $unitriangular ) : self

Private Methods

Méthode Description
checkEqualSize ( self $matrix )
checkSquare ( )
isLiteralValid ( array $literal ) : boolean
pad ( integer $size ) : self
recursiveSolveInverse ( self $source ) : self
subArraysAreEqualSize ( array $subArrays ) : boolean

Method Details

__construct() public méthode

Example: $transform = new Matrix([ [0, 1, 2], [3, 4, 5], [6, 7, 8] ]);
public __construct ( array $literal )
$literal array Array representation of the matrix.

addMatrix() public méthode

public addMatrix ( self $value ) : self
$value self
Résultat self

addScalar() public méthode

public addScalar ( float $value ) : self
$value float
Résultat self

adjugate() public méthode

public adjugate ( ) : self
Résultat self

concatenateBottom() public méthode

public concatenateBottom ( self $other ) : self
$other self
Résultat self

concatenateRight() public méthode

public concatenateRight ( self $other ) : self
$other self
Résultat self

determinant() public méthode

public determinant ( ) : float
Résultat float

diagonal() public méthode

public diagonal ( ) : self
Résultat self

entrywise() public méthode

public entrywise ( self $value ) : self
$value self
Résultat self

equals() public méthode

public equals ( Matrix $matrix ) : boolean
$matrix Matrix
Résultat boolean

get() public méthode

public get ( integer $row, integer $column ) : float
$row integer
$column integer
Résultat float

getColumnCount() public méthode

public getColumnCount ( ) : integer
Résultat integer

getRowCount() public méthode

public getRowCount ( ) : integer
Résultat integer

identity() public static méthode

public static identity ( integer $size ) : self
$size integer How many rows and columns the identity matrix should have
Résultat self

inverse() public méthode

public inverse ( ) : self
Résultat self

isSquare() public méthode

public isSquare ( ) : boolean
Résultat boolean

lower() public méthode

public lower ( boolean $unitriangular ) : self
$unitriangular boolean True to have ones along the diagonal. False to include parent matrix values, instead.
Résultat self

map() public méthode

Iterates over the current matrix with a callback function to return a new matrix with the mapped values. $callback takes four arguments: - The current matrix element - The current row - The current column - The matrix being iterated over
public map ( callable $callback ) : self
$callback callable
Résultat self

multiplyMatrix() public méthode

public multiplyMatrix ( self $value ) : self
$value self
Résultat self

multiplyScalar() public méthode

public multiplyScalar ( float $value ) : self
$value float
Résultat self

sliceColumns() public méthode

public sliceColumns ( integer $offset, integer $length = null ) : self
$offset integer
$length integer
Résultat self

sliceRows() public méthode

public sliceRows ( integer $offset, integer $length = null ) : self
$offset integer
$length integer
Résultat self

spliceColumns() public méthode

public spliceColumns ( integer $offset, integer $length = null, array $replacement = null ) : self
$offset integer
$length integer
$replacement array
Résultat self

spliceRows() public méthode

public spliceRows ( integer $offset, integer $length = null, array $replacement = null ) : self
$offset integer
$length integer
$replacement array
Résultat self

subtractMatrix() public méthode

public subtractMatrix ( self $value ) : self
$value self
Résultat self

subtractScalar() public méthode

public subtractScalar ( float $value ) : self
$value float
Résultat self

toArray() public méthode

public toArray ( ) : array
Résultat array

trace() public méthode

public trace ( ) : float
Résultat float

transpose() public méthode

public transpose ( ) : self
Résultat self

upper() public méthode

public upper ( boolean $unitriangular ) : self
$unitriangular boolean True to have ones along the diagonal. False to include parent matrix values, instead.
Résultat self