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;
    }
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;
    }
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 ; }
Compute the dot product of this vector and another vector.

@param \Rubix\Tensor\Vector $b
@throws \Rubix\Tensor\Exceptions\DimensionalityMismatchException
@return int|float
Compute the dot product of this vector and another vector .