mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 14:58:42 +00:00
Added independent symmetry check
This commit is contained in:
parent
31209d2b30
commit
e611105b60
|
|
@ -278,7 +278,14 @@ class Matrix implements \ArrayAccess, \Iterator
|
||||||
*/
|
*/
|
||||||
public function isSymmetric() : bool
|
public function isSymmetric() : bool
|
||||||
{
|
{
|
||||||
return (new EigenvalueDecomposition($this))->isSymmetric();
|
$isSymmetric = true;
|
||||||
|
for ($j = 0; ($j < $this->m) & $isSymmetric; ++$j) {
|
||||||
|
for ($i = 0; ($i < $this->n) & $isSymmetric; ++$i) {
|
||||||
|
$isSymmetric = ($this->matrix[$i][$j] === $this->matrix[$j][$i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $isSymmetric;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user