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 311] [Versions 310 and 400] [Versions 310 and 401]

(no description)

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

Defines 1 class

EigenvalueDecomposition:: (10 methods):
  tred2()
  tql2()
  orthes()
  cdiv()
  hqr2()
  __construct()
  getV()
  getRealEigenvalues()
  getImagEigenvalues()
  getD()


Class: EigenvalueDecomposition  - X-Ref

Class to obtain eigenvalues and eigenvectors of a real matrix.

If A is symmetric, then A = V*D*V' where the eigenvalue matrix D
is diagonal and the eigenvector matrix V is orthogonal (i.e.
A = V.times(D.times(V.transpose())) and V.times(V.transpose())
equals the identity matrix).

If A is not symmetric, then the eigenvalue matrix D is block diagonal
with the real eigenvalues in 1-by-1 blocks and any complex eigenvalues,
lambda + i*mu, in 2-by-2 blocks, [lambda, mu; -mu, lambda].  The
columns of V represent the eigenvectors in the sense that A*V = V*D,
i.e. A.times(V) equals V.times(D).  The matrix V may be badly
conditioned, or even singular, so the validity of the equation
A = V*D*inverse(V) depends upon V.cond().

tred2()   X-Ref
Symmetric Householder reduction to tridiagonal form.


tql2()   X-Ref
Symmetric tridiagonal QL algorithm.

This is derived from the Algol procedures tql2, by
Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
Fortran subroutine in EISPACK.

orthes()   X-Ref
Nonsymmetric reduction to Hessenberg form.

This is derived from the Algol procedures orthes and ortran,
by Martin and Wilkinson, Handbook for Auto. Comp.,
Vol.ii-Linear Algebra, and the corresponding
Fortran subroutines in EISPACK.

cdiv($xr, $xi, $yr, $yi)   X-Ref
Performs complex division.

param: mixed $xr
param: mixed $xi
param: mixed $yr
param: mixed $yi

hqr2()   X-Ref
Nonsymmetric reduction from Hessenberg to real Schur form.

Code is derived from the Algol procedure hqr2,
by Martin and Wilkinson, Handbook for Auto. Comp.,
Vol.ii-Linear Algebra, and the corresponding
Fortran subroutine in EISPACK.

__construct($Arg)   X-Ref
Constructor: Check for symmetry, then construct the eigenvalue decomposition.

param: mixed $Arg A Square matrix

getV()   X-Ref
Return the eigenvector matrix.

return: Matrix V

getRealEigenvalues()   X-Ref
Return the real parts of the eigenvalues.

return: array real(diag(D))

getImagEigenvalues()   X-Ref
Return the imaginary parts of the eigenvalues.

return: array imag(diag(D))

getD()   X-Ref
Return the block diagonal eigenvalue matrix.

return: Matrix D