public static function initialize(Dimension $dimension, Number $value): self
    {
        $rows = [];
        $count = $dimension->rows()->value();

        for ($i = 0; $i < $count; ++$i) {
            $rows[] = new RowVector(
                ...array_fill(
                    0,
                    $dimension->columns()->value(),
                    $value
                )
            );
        }

        return new self(...$rows);
    }
public static function initialize(Dimension $dimension, Number $value): self
    {
        $rows = [];
        $count = $dimension->rows()->value();

        for ($i = 0; $i < $count; ++$i) {
            $rows[] = new RowVector(
                ...array_fill(
                    0,
                    $dimension->columns()->value(),
                    $value
                )
            );
        }

        return new self(...$rows);
    }
public static function initialize ( Dimension $ dimension , Number $ value ) : self { $ rows = [ ] ; $ count = $ dimension -> rows ( ) -> value ( ) ; for ( $ i = 0 ; $ i < $ count ; ++ $ i ) { $ rows [ ] = new RowVector ( ... array_fill ( 0 , $ dimension -> columns ( ) -> value ( ) , $ value ) ) ; } return new self ( ... $ rows ) ; }
Initialize a matrix to the wished dimension filled with the specified value
Initialize a matrix to the wished dimension filled with the specified value