public static void mult(DMatrix1Row A, DMatrixD1 B, DMatrixD1 C)
    {
        if( B.numRows == 1 ) {
            if( A.numCols != B.numCols ) {
                throw new MatrixDimensionException("A and B are not compatible");
            }
        } else if( B.numCols == 1 ) {
            if( A.numCols != B.numRows ) {
                throw new MatrixDimensionException("A and B are not compatible");
            }
        } else {
            throw new MatrixDimensionException("B is not a vector");
        }
        C.reshape(A.numRows,1);

        if( A.numCols == 0 ) {
            CommonOps_DDRM.fill(C,0);
            return;
        }

        int indexA = 0;
        int cIndex = 0;
        double b0 = B.get(0);
        for( int i = 0; i < A.numRows; i++ ) {
            double total = A.get(indexA++) * b0;

            for( int j = 1; j < A.numCols; j++ ) {
                total += A.get(indexA++) * B.get(j);
            }

            C.set(cIndex++, total);
        }
    }
public static void mult ( DMatrix1Row A , DMatrixD1 B , DMatrixD1 C ) { if ( B . numRows == 1 ) { if ( A . numCols != B . numCols ) { throw new MatrixDimensionException ( "A and B are not compatible" ) ; } } else if ( B . numCols == 1 ) { if ( A . numCols != B . numRows ) { throw new MatrixDimensionException ( "A and B are not compatible" ) ; } } else { throw new MatrixDimensionException ( "B is not a vector" ) ; } C . reshape ( A . numRows , 1 ) ; if ( A . numCols == 0 ) { CommonOps_DDRM . fill ( C , 0 ) ; return ; } int indexA = 0 ; int cIndex = 0 ; double b0 = B . get ( 0 ) ; for ( int i = 0 ; i < A . numRows ; i ++ ) { double total = A . get ( indexA ++ ) * b0 ; for ( int j = 1 ; j < A . numCols ; j ++ ) { total += A . get ( indexA ++ ) * B . get ( j ) ; } C . set ( cIndex ++ , total ) ; } }
<p>
Performs a matrix vector multiply.<br>
<br>
c = A * b <br>
and<br>
c = A * b<sup>T</sup> <br>
<br>
c<sub>i</sub> = Sum{ j=1:n, a<sub>ij</sub> * b<sub>j</sub>}<br>
<br>
where A is a matrix, b is a column or transposed row vector, and c is a column vector.
</p>

@param A A matrix that is m by n. Not modified.
@param B A vector that has length n. Not modified.
@param C A column vector that has length m. Modified.