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

        $c = [];

        foreach ($b as $i => $row) {
            $valueA = $this->a[$i];

            $temp = [];

            foreach ($row as $valueB) {
                $temp[] = $valueA * $valueB;
            }

            $c[] = $temp;
        }

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

        $c = [];

        foreach ($b as $i => $row) {
            $valueA = $this->a[$i];

            $temp = [];

            foreach ($row as $valueB) {
                $temp[] = $valueA * $valueB;
            }

            $c[] = $temp;
        }

        return Matrix::quick($c);
    }
protected function multiplyMatrix ( Matrix $ b ) : Matrix { if ( $ this -> n !== $ b -> m ( ) ) { throw new DimensionalityMismatchException ( 'Vector A requires' . " $this->n rows but Matrix B has {$b->m()}." ) ; } $ c = [ ] ; foreach ( $ b as $ i => $ row ) { $ valueA = $ this -> a [ $ i ] ; $ temp = [ ] ; foreach ( $ row as $ valueB ) { $ temp [ ] = $ valueA * $ valueB ; } $ c [ ] = $ temp ; } return Matrix :: quick ( $ c ) ; }
Multiply this column vector with a matrix.

@param \Rubix\Tensor\Matrix $b
@throws \Rubix\Tensor\Exceptions\DimensionalityMismatchException
@return \Rubix\Tensor\Matrix
Multiply this column vector with a matrix .