ph-math/src/main/java/com/helger/numbercruncher/matrix/Matrix.java
public RowVector multiply (final RowVector rv) throws MatrixException
  {
    // Validate rv's size.
    if (m_nCols != rv.m_nCols)
    {
      throw new MatrixException (MatrixException.INVALID_DIMENSIONS);
    }

    final float pv[] = new float [m_nRows]; // product values

    // Compute the values of the product.
    for (int c = 0; c < m_nCols; ++c)
    {
      float dot = 0;
      for (int r = 0; r < m_nRows; ++r)
      {
        dot += rv.m_aValues[0][r] * m_aValues[r][c];
      }
      pv[c] = dot;
    }

    return new RowVector (pv);
  }
public RowVector multiply (final RowVector rv) throws MatrixException
  {
    // Validate rv's size.
    if (m_nCols != rv.m_nCols)
    {
      throw new MatrixException (MatrixException.INVALID_DIMENSIONS);
    }

    final float pv[] = new float [m_nRows]; // product values

    // Compute the values of the product.
    for (int c = 0; c < m_nCols; ++c)
    {
      float dot = 0;
      for (int r = 0; r < m_nRows; ++r)
      {
        dot += rv.m_aValues[0][r] * m_aValues[r][c];
      }
      pv[c] = dot;
    }

    return new RowVector (pv);
  }
public RowVector multiply ( final RowVector rv ) throws MatrixException { // Validate rv's size. if ( m_nCols != rv . m_nCols ) { throw new MatrixException ( MatrixException . INVALID_DIMENSIONS ) ; } final float pv [ ] = new float [ m_nRows ] ; // product values // Compute the values of the product. for ( int c = 0 ; c < m_nCols ; ++ c ) { float dot = 0 ; for ( int r = 0 ; r < m_nRows ; ++ r ) { dot += rv . m_aValues [ 0 ] [ r ] * m_aValues [ r ] [ c ] ; } pv [ c ] = dot ; } return new RowVector ( pv ) ; }
Multiply a row vector by this matrix: rv*this

@param rv
the row vector
@return the product row vector
@throws MatrixException
for invalid size
Multiply a row vector by this matrix : rv * this