MathPHP\LinearAlgebra\Vector::add PHP Метод

add() публичный Метод

A = [a₁, a₂, a₃] B = [b₁, b₂, b₃] A + B = [a₁ + b₁, a₂ + b₂, a₃ + b₃]
public add ( Vector $B ) : Vector
$B Vector
Результат Vector
    public function add(Vector $B) : Vector
    {
        if ($B->getN() !== $this->n) {
            throw new Exception\VectorException('Vectors must be the same length for addition');
        }
        $R = Map\Multi::add($this->A, $B->getVector());
        return new Vector($R);
    }