Conditions | 5 |
Paths | 5 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public static function factory(matrix $m): matrix|null { |
||
31 | if ($m->isSquare()) { |
||
32 | $ar = $m->copy(); |
||
33 | $lp = lapack::potrf($ar); |
||
34 | if ($lp != 0) { |
||
35 | return null; |
||
36 | } |
||
37 | for ($i = 0; $i < $m->col; ++$i) { |
||
38 | for ($j = $i + 1; $j < $m->col; ++$j) { |
||
39 | $ar->data[$i * $m->col + $j] = 0.0; |
||
40 | } |
||
41 | } |
||
42 | unset($lp); |
||
43 | return $ar; |
||
44 | } |
||
48 |