mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +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
|
||||
{
|
||||
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