コード例 #1
0
ファイル: Matrix.php プロジェクト: innmind/math
 /**
  * Initialize a matrix to the wisjed dimension filled with the specified value
  */
 public static function initialize(Dimension $dimension, float $value) : self
 {
     $rows = [];
     for ($i = 0; $i < $dimension->rows(); ++$i) {
         $rows[] = new RowVector(...array_fill(0, $dimension->columns(), $value));
     }
     return new self(...$rows);
 }