mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
48 lines
956 B
PHP
48 lines
956 B
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.1
|
|
*
|
|
* @category TBD
|
|
* @package TBD
|
|
* @author OMS Development Team <dev@oms.com>
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link http://orange-management.com
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace phpOMS\Math\Matrix;
|
|
|
|
/**
|
|
* Matrix class
|
|
*
|
|
* @category Framework
|
|
* @package phpOMS\Math\Matrix
|
|
* @author OMS Development Team <dev@oms.com>
|
|
* @license OMS License 1.0
|
|
* @link http://orange-management.com
|
|
* @since 1.0.0
|
|
*/
|
|
class IdentityMatrix extends Matrix
|
|
{
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @param int $n Matrix dimension
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function __constrcut(int $n)
|
|
{
|
|
$this->n = $n;
|
|
$this->m = $n;
|
|
|
|
for ($i = 0; $i < $n; $i++) {
|
|
$this->matrix[$i] = array_fill(0, $n, 0);
|
|
$this->matrix[$i][$i] = 1;
|
|
}
|
|
}
|
|
} |