You are here

public function EigenvalueDecomposition::__construct in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php \EigenvalueDecomposition::__construct()

* Constructor: Check for symmetry, then construct the eigenvalue decomposition * * @access public *

Parameters

A Square matrix: * @return Structure to access D and V.

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php, line 782

Class

EigenvalueDecomposition
@package JAMA

Code

public function __construct($Arg) {
  $this->A = $Arg
    ->getArray();
  $this->n = $Arg
    ->getColumnDimension();
  $issymmetric = true;
  for ($j = 0; $j < $this->n & $issymmetric; ++$j) {
    for ($i = 0; $i < $this->n & $issymmetric; ++$i) {
      $issymmetric = $this->A[$i][$j] == $this->A[$j][$i];
    }
  }
  if ($issymmetric) {
    $this->V = $this->A;

    // Tridiagonalize.
    $this
      ->tred2();

    // Diagonalize.
    $this
      ->tql2();
  }
  else {
    $this->H = $this->A;
    $this->ort = array();

    // Reduce to Hessenberg form.
    $this
      ->orthes();

    // Reduce Hessenberg to real Schur form.
    $this
      ->hqr2();
  }
}