Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
Matrix\Functions Class Reference

Static Public Member Functions

static adjoint ($matrix)
 Return the adjoint of this matrix The adjugate, classical adjoint, or adjunct of a square matrix is the transpose of its cofactor matrix.
 
static antidiagonal ($matrix)
 Return the antidiagonal of this matrix.
 
static cofactors ($matrix)
 Return the cofactors of this matrix.
 
static determinant ($matrix)
 Return the determinant of this matrix.
 
static diagonal ($matrix)
 Return the diagonal of this matrix.
 
static identity ($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.
 
static inverse ($matrix, string $type='inverse')
 Return the inverse of this matrix.
 
static minors ($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.
 
static trace ($matrix)
 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.
 
static transpose ($matrix)
 Return the transpose of this matrix.
 

Static Protected Member Functions

static getMinors (Matrix $matrix)
 Calculate the minors of the matrix.
 

Member Function Documentation

◆ adjoint()

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

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 | array$matrixThe matrix whose adjoint we wish to calculate
Return values
Matrix
Exceptions
Exception

◆ antidiagonal()

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

Return the antidiagonal of this matrix.

Parameters
Matrix | array$matrixThe matrix whose antidiagonal we wish to calculate
Return values
Matrix
Exceptions
Exception

◆ cofactors()

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

Return the cofactors of this matrix.

Parameters
Matrix | array$matrixThe matrix whose cofactors we wish to calculate
Return values
Matrix
Exceptions
Exception

◆ determinant()

static Matrix\Functions::determinant ( $matrix)
static

Return the determinant of this matrix.

Parameters
Matrix | array$matrixThe matrix whose determinant we wish to calculate
Return values
float
Exceptions
Exception

◆ diagonal()

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

Return the diagonal of this matrix.

Parameters
Matrix | array$matrixThe matrix whose diagonal we wish to calculate
Return values
Matrix
Exceptions
Exception

◆ getMinors()

static Matrix\Functions::getMinors ( Matrix $matrix)
staticprotected

Calculate the minors of the matrix.

Parameters
Matrix$matrixThe matrix whose minors we wish to calculate
Return values
array[]
Exceptions
Exception

◆ identity()

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

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 | array$matrixThe matrix whose identity we wish to calculate
Return values
Matrix
Exceptions
Exception

◆ inverse()

static Matrix\Functions::inverse ( $matrix,
string $type = 'inverse' )
static

Return the inverse of this matrix.

Parameters
Matrix | array$matrixThe matrix whose inverse we wish to calculate
Return values
Matrix
Exceptions
Exception

◆ minors()

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

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 | array$matrixThe matrix whose minors we wish to calculate
Return values
Matrix
Exceptions
Exception

◆ trace()

static Matrix\Functions::trace ( $matrix)
static

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 | array$matrixThe matrix whose trace we wish to calculate
Return values
float
Exceptions
Exception

◆ transpose()

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

Return the transpose of this matrix.

Parameters
Matrix | a$matrixThe matrix whose transpose we wish to calculate
Return values
Matrix

The documentation for this class was generated from the following file: