public static function createFilledMatrix($value, $rows, $columns = null)
    {
        if ($columns === null) {
            $columns = $rows;
        }

        $rows = Matrix::validateRow($rows);
        $columns = Matrix::validateColumn($columns);

        return new Matrix(
            array_fill(
                0,
                $rows,
                array_fill(
                    0,
                    $columns,
                    $value
                )
            )
        );
    }
public static function createFilledMatrix($value, $rows, $columns = null)
    {
        if ($columns === null) {
            $columns = $rows;
        }

        $rows = Matrix::validateRow($rows);
        $columns = Matrix::validateColumn($columns);

        return new Matrix(
            array_fill(
                0,
                $rows,
                array_fill(
                    0,
                    $columns,
                    $value
                )
            )
        );
    }
public static function createFilledMatrix ( $ value , $ rows , $ columns = null ) { if ( $ columns === null ) { $ columns = $ rows ; } $ rows = Matrix :: validateRow ( $ rows ) ; $ columns = Matrix :: validateColumn ( $ columns ) ; return new Matrix ( array_fill ( 0 , $ rows , array_fill ( 0 , $ columns , $ value ) ) ) ; }
Create a new matrix of specified dimensions, and filled with a specified value
If the column argument isn't provided, then a square matrix will be created

@param $value
@param $rows
@param null $columns
@return Matrix
@throws Exception
Create a new matrix of specified dimensions and filled with a specified value If the column argument isn t provided then a square matrix will be created