ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
trace.php
Go to the documentation of this file.
1 <?php
2 
11 namespace Matrix;
12 
20 if (!function_exists(__NAMESPACE__ . '\\trace')) {
21  function trace($matrix): float
22  {
23  if (is_array($matrix)) {
24  $matrix = new Matrix($matrix);
25  }
26  if (!$matrix instanceof Matrix) {
27  throw new Exception('Must be Matrix or array');
28  }
29 
30  return Functions::trace($matrix);
31  }
32 }
static trace(Matrix $matrix)
Return the trace of this matrix The trace is defined as the sum of the elements on the main diagonal ...
Definition: Functions.php:306
$matrix
Definition: test.php:18
Class for the creating "special" Matrices.
Definition: Builder.php:11