protected function multiplyVector(Vector $b) : self
    {
        if ($b->n() !== $this->n) {
            throw new DimensionalityMismatchException('Matrix A requires'
                . " $this->n columns but Vector B has {$b->n()}.");
        }

        $c = [];

        foreach ($this->a as $row) {
            $temp = [];

            foreach ($row as $j => $value) {
                $temp[] = $value * $b[$j];
            }

            $c[] = $temp;
        }

        return self::quick($c);
    }
protected function multiplyVector(Vector $b) : self
    {
        if ($b->n() !== $this->n) {
            throw new DimensionalityMismatchException('Matrix A requires'
                . " $this->n columns but Vector B has {$b->n()}.");
        }

        $c = [];

        foreach ($this->a as $row) {
            $temp = [];

            foreach ($row as $j => $value) {
                $temp[] = $value * $b[$j];
            }

            $c[] = $temp;
        }

        return self::quick($c);
    }
protected function multiplyVector ( Vector $ b ) : self { if ( $ b -> n ( ) !== $ this -> n ) { throw new DimensionalityMismatchException ( 'Matrix A requires' . " $this->n columns but Vector B has {$b->n()}." ) ; } $ c = [ ] ; foreach ( $ this -> a as $ row ) { $ temp = [ ] ; foreach ( $ row as $ j => $ value ) { $ temp [ ] = $ value * $ b [ $ j ] ; } $ c [ ] = $ temp ; } return self :: quick ( $ c ) ; }
Multiply this matrix by a vector.

@param \Rubix\Tensor\Vector $b
@throws \Rubix\Tensor\Exceptions\DimensionalityMismatchException
@return self
Multiply this matrix by a vector .