Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

(no description)

File Size: 337 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Functions:: (15 methods):
  getAdjoint()
  adjoint()
  getCofactors()
  cofactors()
  getDeterminantSegment()
  getDeterminant()
  determinant()
  diagonal()
  antidiagonal()
  identity()
  inverse()
  getMinors()
  minors()
  trace()
  transpose()


Class: Functions  - X-Ref

getAdjoint(Matrix $matrix)   X-Ref
Calculate the adjoint of the matrix

param: Matrix $matrix The matrix whose adjoint we wish to calculate
return: Matrix

adjoint(Matrix $matrix)   X-Ref
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.

param: Matrix $matrix The matrix whose adjoint we wish to calculate
return: Matrix

getCofactors(Matrix $matrix)   X-Ref
Calculate the cofactors of the matrix

param: Matrix $matrix The matrix whose cofactors we wish to calculate
return: Matrix

cofactors(Matrix $matrix)   X-Ref
Return the cofactors of this matrix

param: Matrix $matrix The matrix whose cofactors we wish to calculate
return: Matrix

getDeterminantSegment(Matrix $matrix, $row, $column)   X-Ref

param: Matrix $matrix
param: int $row
param: int $column
return: float

getDeterminant(Matrix $matrix)   X-Ref
No description

determinant(Matrix $matrix)   X-Ref
Return the determinant of this matrix

param: Matrix $matrix The matrix whose determinant we wish to calculate
return: float

diagonal(Matrix $matrix)   X-Ref
Return the diagonal of this matrix

param: Matrix $matrix The matrix whose diagonal we wish to calculate
return: Matrix

antidiagonal(Matrix $matrix)   X-Ref
Return the antidiagonal of this matrix

param: Matrix $matrix The matrix whose antidiagonal we wish to calculate
return: Matrix

identity(Matrix $matrix)   X-Ref
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

param: Matrix $matrix The matrix whose identity we wish to calculate
return: Matrix

inverse(Matrix $matrix)   X-Ref
Return the inverse of this matrix

param: Matrix $matrix The matrix whose inverse we wish to calculate
return: Matrix

getMinors(Matrix $matrix)   X-Ref
Calculate the minors of the matrix

param: Matrix $matrix The matrix whose minors we wish to calculate
return: array[]

minors(Matrix $matrix)   X-Ref
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.

param: Matrix $matrix The matrix whose minors we wish to calculate
return: Matrix

trace(Matrix $matrix)   X-Ref
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

param: Matrix $matrix The matrix whose trace we wish to calculate
return: float

transpose(Matrix $matrix)   X-Ref
Return the transpose of this matrix

param: Matrix $matrix The matrix whose transpose we wish to calculate
return: Matrix