public function divide($b)
    {
        switch (true) {
            case $b instanceof Matrix:
                $c = $this->divideMatrix($b);
                break;

            case $b instanceof ColumnVector:
                $c = $this->divideColumnVector($b);
                break;
            
            case $b instanceof Vector:
                $c = $this->divideVector($b);
                break;

            case is_int($b) or is_float($b):
                $c = $this->divideScalar($b);
                break;

            default:
                throw new InvalidArgumentException('Cannot divide matrix'
                    . ' with a ' . gettype($b) . '.');
        }

        return $c;
    }
public function divide($b)
    {
        switch (true) {
            case $b instanceof Matrix:
                $c = $this->divideMatrix($b);
                break;

            case $b instanceof ColumnVector:
                $c = $this->divideColumnVector($b);
                break;
            
            case $b instanceof Vector:
                $c = $this->divideVector($b);
                break;

            case is_int($b) or is_float($b):
                $c = $this->divideScalar($b);
                break;

            default:
                throw new InvalidArgumentException('Cannot divide matrix'
                    . ' with a ' . gettype($b) . '.');
        }

        return $c;
    }
public function divide ( $ b ) { switch ( true ) { case $ b instanceof Matrix : $ c = $ this -> divideMatrix ( $ b ) ; break ; case $ b instanceof ColumnVector : $ c = $ this -> divideColumnVector ( $ b ) ; break ; case $ b instanceof Vector : $ c = $ this -> divideVector ( $ b ) ; break ; case is_int ( $ b ) or is_float ( $ b ) : $ c = $ this -> divideScalar ( $ b ) ; break ; default : throw new InvalidArgumentException ( 'Cannot divide matrix' . ' with a ' . gettype ( $ b ) . '.' ) ; } return $ c ; }
A universal function to divide this matrix by another tensor
element-wise.

@param mixed $b
@throws \InvalidArgumentException
@return mixed
A universal function to divide this matrix by another tensor element - wise .