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;
    }