ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
diagonal.php
Go to the documentation of this file.
1<?php
2
11namespace Matrix;
12
20if (!function_exists(__NAMESPACE__ . '\\diagonal')) {
21 function diagonal($matrix): Matrix
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
31 }
32}
An exception for terminatinating execution or to throw for unit testing.
static diagonal(Matrix $matrix)
Return the diagonal of this matrix.
Definition: Functions.php:164
$matrix
Definition: test.php:18
Class for the creating "special" Matrices.
Definition: Builder.php:11