You are here

public function PHPExcel_Shared_JAMA_Matrix::trace in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/JAMA/Matrix.php \PHPExcel_Shared_JAMA_Matrix::trace()

* trace * * Sum of diagonal elements *

Return value

float Sum of diagonal elements

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/JAMA/Matrix.php, line 397

Class

PHPExcel_Shared_JAMA_Matrix

Code

public function trace() {
  $s = 0;
  $n = min($this->m, $this->n);
  for ($i = 0; $i < $n; ++$i) {
    $s += $this->A[$i][$i];
  }
  return $s;
}