src/Vector.php
protected function _checkVectorSpace(self $b)
    {
        if (!$this->isSameDimension($b)) {
            throw new Exception('The vectors must be of the same dimension');
        }

        if (!$this->isSameVectorSpace($b)) {
            throw new Exception('The vectors\' components must have the same keys');
        }
    }
protected function _checkVectorSpace(self $b)
    {
        if (!$this->isSameDimension($b)) {
            throw new Exception('The vectors must be of the same dimension');
        }

        if (!$this->isSameVectorSpace($b)) {
            throw new Exception('The vectors\' components must have the same keys');
        }
    }
Checks that the vector spaces of the two vectors are the same.

The vectors must be of the same dimension and have the same keys in their
components.

@internal
@param self $b The vector to check against.
@return void
@throws Exception if the vectors are not of the same dimension.
@throws Exception if the vectors' components down have the same keys.