/**
   * Multiplies the transpose of vector v1 (ie, v1 becomes a row vector with respect to the
   * multiplication) times matrix m1 and places the result into this vector (this =
   * transpose(v1)*m1). The result is technically a row vector, but the GVector class only knows
   * about column vectors, and so the result is stored as a column vector.
   *
   * @param m1 The matrix in the multiplication
   * @param v1 The vector that is temporarily transposed
   */
  public final void mul(GVector v1, GMatrix m1) {
    if (m1.getNumRow() != v1.length)
      throw new MismatchedSizeException(VecMathI18N.getString("GVector12"));

    if (length != m1.getNumCol())
      throw new MismatchedSizeException(VecMathI18N.getString("GVector13"));

    double v[];
    if (v1 != this) {
      v = v1.values;
    } else {
      v = (double[]) values.clone();
    }

    for (int j = length - 1; j >= 0; j--) {
      values[j] = 0.0;
      for (int i = v1.length - 1; i >= 0; i--) {
        values[j] += m1.values[i][j] * v[i];
      }
    }
  }