code: public static RealMatrix rbrMultiply(RealMatrix matrix, RealVector vector) {
          // Define the return value:
          RealMatrix retval = MatrixUtils.createRealMatrix(matrix.getRowDimension(), matrix.getColumnDimension());
  
          // Iterate over rows:
          for (int i = 0; i < retval.getRowDimension(); i++) {
              retval.setRowVector(i, matrix.getRowVector(i).ebeMultiply(vector));
          }
  
          // Done, return:
          return retval;
      }
docs: Multiplies the matrix' rows using the vector element-by-element.
  
  @param matrix The input matrix.
  @param vector The vector which will be used to multiply rows of the matrix element-by-element.
  @return The new matrix of which rows are multiplied with the vector element-by-element.