// policy class for multiplicative underlyings
// BEGIN underlyingChildValue
struct Multiplicative
{
  /* returns the stock value for a child given:
   *
   * parent is the parent's stock value
   * c is the requested child # stock value
   * T is the current time step
   * M is the vector of factors (of size [N][Q] if time dependent,
   *   otherwise size [1][Q])
   */
  double underlyingChildValue(double parent, int c, int T, vector<vector<double> > M)
  {
    assert((unsigned int)c < M[0].size());

    if(M.size() > 1)                   // is M time dependent?
      return parent * M[T][c];
    else
      return parent * M[0][c];     // no, use 0th vector for multiplicative factor
  }
};
// END underlyingChildValue




