function _validateDim (x, y) {
    const xSize = _size(x)
    const ySize = _size(y)
    let xLen, yLen

    if (xSize.length === 1) {
      xLen = xSize[0]
    } else if (xSize.length === 2 && xSize[1] === 1) {
      xLen = xSize[0]
    } else {
      throw new RangeError('Expected a column vector, instead got a matrix of size (' + xSize.join(', ') + ')')
    }

    if (ySize.length === 1) {
      yLen = ySize[0]
    } else if (ySize.length === 2 && ySize[1] === 1) {
      yLen = ySize[0]
    } else {
      throw new RangeError('Expected a column vector, instead got a matrix of size (' + ySize.join(', ') + ')')
    }

    if (xLen !== yLen) throw new RangeError('Vectors must have equal length (' + xLen + ' != ' + yLen + ')')
    if (xLen === 0) throw new RangeError('Cannot calculate the dot product of empty vectors')

    return xLen
  }
Calculate the dot product of two vectors. The dot product of
`A = [a1, a2, ..., an]` and `B = [b1, b2, ..., bn]` is defined as:

   dot(A, B) = conj(a1) * b1 + conj(a2) * b2 + ... + conj(an) * bn

Syntax:

   math.dot(x, y)

Examples:

   math.dot([2, 4, 1], [2, 2, 3])       // returns number 15
   math.multiply([2, 4, 1], [2, 2, 3])  // returns number 15

See also:

   multiply, cross

@param  {Array | Matrix} x     First vector
@param  {Array | Matrix} y     Second vector
@return {number}               Returns the dot product of `x` and `y`