public function dot(Vector $b)
    {
        if ($this->n !== $b->size()) {
            throw new DimensionalityMismatchException('Vector A'
                . " requires $this->n elements but B has {$b->size()}.");
        }

        $sigma = 0.;

        foreach ($this->a as $i => $value) {
            $sigma += $value * $b[$i];
        }

        return $sigma;
    }