Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401]

Class to obtain eigenvalues and eigenvectors of a real matrix.

Author: Paul Meagher
Author: Mustafa Karabulut
License: PHP v3.0
Version: 1.1
File Size: 960 lines (33 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

EigenvalueDecomposition:: (10 methods):
  __construct()
  getEigenvectors()
  getRealEigenvalues()
  getImagEigenvalues()
  getDiagonalEigenvalues()
  tred2()
  tql2()
  orthes()
  cdiv()
  hqr2()


Class: EigenvalueDecomposition  - X-Ref

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


getEigenvectors()   X-Ref
Return the eigenvector matrix


getRealEigenvalues()   X-Ref
Return the real parts of the eigenvalues<br>
d = real(diag(D));


getImagEigenvalues()   X-Ref
Return the imaginary parts of the eigenvalues <br>
d = imag(diag(D))


getDiagonalEigenvalues()   X-Ref
Return the block diagonal eigenvalue matrix


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: int|float $xr
param: int|float $xi
param: int|float $yr
param: int|float $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.