Method |
Description |
|
LUDecomposition ( ) : array |
LU Decomposition (Doolittle decomposition) with pivoting via permutation matrix |
|
__construct ( array $A ) |
Constructor |
|
__toString ( ) : string |
Print the matrix as a string
Format is as a matrix, not as the underlying array structure. |
|
add ( Matrix $B ) : Matrix |
Add two matrices - Entrywise sum
Adds each element of one matrix to the same element in the other matrix. |
|
augment ( Matrix $B ) : Matrix |
Augment a matrix
An augmented matrix is a matrix obtained by appending the columns of two given matrices |
|
augmentBelow ( Matrix $B ) : Matrix |
Augment a matrix from below
An augmented matrix is a matrix obtained by appending the rows of two given matrices |
|
augmentIdentity ( ) : Matrix |
Augment a matrix with its identity matrix |
|
cofactor ( integer $mᵢ, integer $nⱼ ) : number |
Cofactor
Multiply the minor by (-1)ⁱ⁺ʲ. |
|
cofactorMatrix ( ) : SquareMatrix |
Cofactor matrix
A matrix where each element is a cofactor. |
|
columnAdd ( integer $nᵢ, integer $nⱼ, integer $k ) : Matrix |
Add k times column nᵢ to column nⱼ |
|
columnExclude ( integer $nᵢ ) : Matrix |
Exclude a column from the result matrix |
|
columnInterchange ( integer $nᵢ, integer $nⱼ ) : Matrix |
Interchange two columns |
|
columnMultiply ( integer $nᵢ, integer $k ) : Matrix |
Multiply a column by a factor k |
|
det ( ) : number |
Determinant |
|
diagonal ( ) : Matrix |
Diagonal matrix
Retains the elements along the main diagonal. |
|
directSum ( Matrix $B ) : Matrix |
Direct sum of two matrices: A ⊕ B
The direct sum of any pair of matrices A of size m × n and B of size p × q
is a matrix of size (m + p) × (n + q)
https://en.wikipedia.org/wiki/Matrix_addition#Direct_sum |
|
frobeniusNorm ( ) : number |
Frobenius norm (Hilbert–Schmidt norm, Euclidean norm) (‖A‖F)
Square root of the sum of the square of all elements. |
|
get ( integer $i, integer $j ) : number |
Get a specific value at row i, column j |
|
getColumn ( integer $j ) : array |
Get single column from the matrix |
|
getDiagonalElements ( ) : array |
Returns the elements on the diagonal of a square matrix as an array
[1 2 3]
A = [4 5 6]
[7 8 9] |
|
getM ( ) : integer |
Get row count (m) |
|
getMatrix ( ) : array |
Get matrix |
|
getN ( ) : integer |
Get column count (n) |
|
getRow ( integer $i ) : array |
Get single row from the matrix |
|
hadamardProduct ( Matrix $B ) : Matrix |
Hadamard product (A∘B)
Also known as the Schur product, or the entrywise product |
|
infinityNorm ( ) : number |
Infinity norm (‖A‖∞)
Maximum absolute row sum of the matrix |
|
inverse ( ) : Matrix |
Inverse |
|
isSquare ( ) : boolean |
Is the matrix a square matrix?
Do rows m = columns n? |
|
isSymmetric ( ) : boolean |
Is the matrix symmetric?
Does A = Aᵀ |
|
jsonSerialize ( ) |
************************************************************************
JsonSerializable INTERFACE
************************************************************************ |
|
kroneckerProduct ( Matrix $B ) : Matrix |
Kronecker product (A⊗B) |
|
map ( callable $func ) : Matrix |
Map a function over all elements of the Matrix |
|
maxNorm ( ) : number |
Max norm (‖A‖max)
Elementwise max |
|
minor ( integer $mᵢ, integer $nⱼ ) : number |
Minor (first minor)
The determinant of some smaller square matrix, cut down from A by removing one of its rows and columns. |
|
minorMatrix ( integer $mᵢ, integer $nⱼ ) : SquareMatrix |
Minor matrix
Submatrix formed by deleting the iᵗʰ row and jᵗʰ column. |
|
multiply ( Matrix/Vector $B ) : Matrix |
Matrix multiplication
https://en.wikipedia.org/wiki/Matrix_multiplication#Matrix_product_.28two_matrices.29 |
|
offsetExists ( $i ) : boolean |
************************************************************************
ArrayAccess INTERFACE
************************************************************************ |
|
offsetGet ( $i ) |
|
|
offsetSet ( $i, $value ) |
|
|
offsetUnset ( $i ) |
|
|
oneNorm ( ) : number |
1-norm (‖A‖₁)
Maximum absolute column sum of the matrix |
|
rowAdd ( integer $mᵢ, integer $mⱼ, integer $k ) : Matrix |
Add k times row mᵢ to row mⱼ |
|
rowAddScalar ( integer $mᵢ, integer $k ) : Matrix |
Add a scalar k to each item of a row |
|
rowDivide ( integer $mᵢ, integer $k ) : Matrix |
Divide a row by a divisor k |
|
rowExclude ( integer $mᵢ ) : Matrix |
Exclude a row from the result matrix |
|
rowInterchange ( integer $mᵢ, integer $mⱼ ) : Matrix |
Interchange two rows |
|
rowMultiply ( integer $mᵢ, integer $k ) : Matrix |
Multiply a row by a factor k |
|
rowSubtract ( integer $mᵢ, integer $mⱼ, number $k ) : Matrix |
Subtract k times row mᵢ to row mⱼ |
|
rowSubtractScalar ( integer $mᵢ, integer $k ) : Matrix |
Subtract a scalar k to each item of a row |
|
rref ( ) : Matrix |
Ruduced row echelon form (row canonical form) |
|
scalarMultiply ( number $λ ) : Matrix |
Scalar matrix multiplication
https://en.wikipedia.org/wiki/Matrix_multiplication#Scalar_multiplication |
|
solve ( Vector/array $b ) : Vector |
Solve linear system of equations
Ax = b
where:
A: Matrix
x: unknown to solve for
b: solution to linear system of equations (input to function) |
|
subtract ( Matrix $B ) : Matrix |
Subtract two matrices - Entrywise subtraction
Adds each element of one matrix to the same element in the other matrix. |
|
trace ( ) : number |
Trace
the trace of an n-by-n square matrix A is defined to be
the sum of the elements on the main diagonal
(the diagonal from the upper left to the lower right). |
|
transpose ( ) : Matrix |
Transpose matrix |
|