public static function fill($value, int $m, int $n) : self
    {
        if (!is_int($value) and !is_float($value)) {
            throw new InvalidArgumentException('Fill value must be an'
                . ' integer or float, ' . gettype($value) . ' found.');
        }

        if ($m < 1 or $n < 1) {
            throw new InvalidArgumentException('Dimensionality must be'
                . ' greater than 0 on all axes.');
        }

        $a = array_fill(0, $m, array_fill(0, $n, $value));

        return self::quick($a);
    }
public static function fill($value, int $m, int $n) : self
    {
        if (!is_int($value) and !is_float($value)) {
            throw new InvalidArgumentException('Fill value must be an'
                . ' integer or float, ' . gettype($value) . ' found.');
        }

        if ($m < 1 or $n < 1) {
            throw new InvalidArgumentException('Dimensionality must be'
                . ' greater than 0 on all axes.');
        }

        $a = array_fill(0, $m, array_fill(0, $n, $value));

        return self::quick($a);
    }
public static function fill ( $ value , int $ m , int $ n ) : self { if ( ! is_int ( $ value ) and ! is_float ( $ value ) ) { throw new InvalidArgumentException ( 'Fill value must be an' . ' integer or float, ' . gettype ( $ value ) . ' found.' ) ; } if ( $ m < 1 or $ n < 1 ) { throw new InvalidArgumentException ( 'Dimensionality must be' . ' greater than 0 on all axes.' ) ; } $ a = array_fill ( 0 , $ m , array_fill ( 0 , $ n , $ value ) ) ; return self :: quick ( $ a ) ; }
Fill a matrix with a given value at each element.

@param mixed $value
@param int $m
@param int $n
@throws \InvalidArgumentException
@return self
Fill a matrix with a given value at each element .