You are here

public function PHPExcel_Shared_JAMA_Matrix::diagonal 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::diagonal()

* diagonal * * Generate a diagonal matrix *

Parameters

int $m Row dimension: * @param int $n Column dimension * @param mixed $c Diagonal value * @return Matrix Diagonal matrix

1 call to PHPExcel_Shared_JAMA_Matrix::diagonal()
PHPExcel_Shared_JAMA_Matrix::identity in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/JAMA/Matrix.php
* identity * * Generate an identity matrix. *

File

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

Class

PHPExcel_Shared_JAMA_Matrix

Code

public function diagonal($m = null, $n = null, $c = 1) {
  $R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
  for ($i = 0; $i < $m; ++$i) {
    $R
      ->set($i, $i, $c);
  }
  return $R;
}