public static function minimum(Matrix $a, Matrix $b) : self
    {
        if ($a->m() !== $b->m()) {
            throw new DimensionalityMismatchException('Matrix A needs'
                . " {$a->m()} rows but Matrix B has {$b->m()}.");
        }

        if ($a->n() !== $b->n()) {
            throw new DimensionalityMismatchException('Matrix A needs'
                . " {$a->n()} columns but Matrix B has {$b->n()}.");
        }

        $c = [];

        foreach ($a as $i => $row) {
            $c[] = array_map('min', $row, $b[$i]);
        }

        return self::quick($c);
    }
public static function minimum(Matrix $a, Matrix $b) : self
    {
        if ($a->m() !== $b->m()) {
            throw new DimensionalityMismatchException('Matrix A needs'
                . " {$a->m()} rows but Matrix B has {$b->m()}.");
        }

        if ($a->n() !== $b->n()) {
            throw new DimensionalityMismatchException('Matrix A needs'
                . " {$a->n()} columns but Matrix B has {$b->n()}.");
        }

        $c = [];

        foreach ($a as $i => $row) {
            $c[] = array_map('min', $row, $b[$i]);
        }

        return self::quick($c);
    }
public static function minimum ( Matrix $ a , Matrix $ b ) : self { if ( $ a -> m ( ) !== $ b -> m ( ) ) { throw new DimensionalityMismatchException ( 'Matrix A needs' . " {$a->m()} rows but Matrix B has {$b->m()}." ) ; } if ( $ a -> n ( ) !== $ b -> n ( ) ) { throw new DimensionalityMismatchException ( 'Matrix A needs' . " {$a->n()} columns but Matrix B has {$b->n()}." ) ; } $ c = [ ] ; foreach ( $ a as $ i => $ row ) { $ c [ ] = array_map ( 'min' , $ row , $ b [ $ i ] ) ; } return self :: quick ( $ c ) ; }
Return the elementwise minimum of two matrices.

@param \Rubix\Tensor\Matrix $a
@param \Rubix\Tensor\Matrix $b
@throws \Rubix\Tensor\Exceptions\DimensionalityMismatchException
@return self
Return the elementwise minimum of two matrices .