\MatrixFunctions

Summary

Methods
Properties
Constants
adjoint()
cofactors()
determinant()
diagonal()
antidiagonal()
identity()
inverse()
minors()
trace()
transpose()
No public properties found
No constants found
getMinors()
No protected properties found
N/A
getAdjoint()
getCofactors()
getDeterminantSegment()
getDeterminant()
No private properties found
N/A

Methods

adjoint()

adjoint(\Matrix\Matrix  $matrix) : \Matrix\Matrix

Return the adjoint of this matrix The adjugate, classical adjoint, or adjunct of a square matrix is the transpose of its cofactor matrix.

The adjugate has sometimes been called the "adjoint", but today the "adjoint" of a matrix normally refers to its corresponding adjoint operator, which is its conjugate transpose.

Parameters

\Matrix\Matrix $matrix

The matrix whose adjoint we wish to calculate

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

cofactors()

cofactors(\Matrix\Matrix  $matrix) : \Matrix\Matrix

Return the cofactors of this matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose cofactors we wish to calculate

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

determinant()

determinant(\Matrix\Matrix  $matrix) : float

Return the determinant of this matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose determinant we wish to calculate

Throws

\Matrix\Exception

Returns

float —

diagonal()

diagonal(\Matrix\Matrix  $matrix) : \Matrix\Matrix

Return the diagonal of this matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose diagonal we wish to calculate

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

antidiagonal()

antidiagonal(\Matrix\Matrix  $matrix) : \Matrix\Matrix

Return the antidiagonal of this matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose antidiagonal we wish to calculate

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

identity()

identity(\Matrix\Matrix  $matrix) : \Matrix\Matrix

Return the identity matrix The identity matrix, or sometimes ambiguously called a unit matrix, of size n is the n × n square matrix with ones on the main diagonal and zeros elsewhere

Parameters

\Matrix\Matrix $matrix

The matrix whose identity we wish to calculate

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

inverse()

inverse(\Matrix\Matrix  $matrix) : \Matrix\Matrix

Return the inverse of this matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose inverse we wish to calculate

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

minors()

minors(\Matrix\Matrix  $matrix) : \Matrix\Matrix

Return the minors of the matrix The minor of a matrix A is the determinant of some smaller square matrix, cut down from A by removing one or more of its rows or columns.

Minors obtained by removing just one row and one column from square matrices (first minors) are required for calculating matrix cofactors, which in turn are useful for computing both the determinant and inverse of square matrices.

Parameters

\Matrix\Matrix $matrix

The matrix whose minors we wish to calculate

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

trace()

trace(\Matrix\Matrix  $matrix) : float

Return the trace of this matrix The trace is defined as the sum of the elements on the main diagonal (the diagonal from the upper left to the lower right) of the matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose trace we wish to calculate

Throws

\Matrix\Exception

Returns

float —

transpose()

transpose(\Matrix\Matrix  $matrix) : \Matrix\Matrix

Return the transpose of this matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose transpose we wish to calculate

Returns

\Matrix\Matrix —

getMinors()

getMinors(\Matrix\Matrix  $matrix) : array[]

Calculate the minors of the matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose minors we wish to calculate

Throws

\Matrix\Exception

Returns

array[] —

getAdjoint()

getAdjoint(\Matrix\Matrix  $matrix) : \Matrix\Matrix

Calculate the adjoint of the matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose adjoint we wish to calculate

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

getCofactors()

getCofactors(\Matrix\Matrix  $matrix) : \Matrix\Matrix

Calculate the cofactors of the matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose cofactors we wish to calculate

Throws

\Matrix\Exception

Returns

\Matrix\Matrix —

getDeterminantSegment()

getDeterminantSegment(\Matrix\Matrix  $matrix, int  $row, int  $column) : float

Parameters

\Matrix\Matrix $matrix
int $row
int $column

Throws

\Matrix\Exception

Returns

float —

getDeterminant()

getDeterminant(\Matrix\Matrix  $matrix) : float

Calculate the determinant of the matrix

Parameters

\Matrix\Matrix $matrix

The matrix whose determinant we wish to calculate

Throws

\Matrix\Exception

Returns

float —