public double atmRate(final Leg leg,final Handle<YieldTermStructure> discountCurve,final Date settlementDate,final Date npvDate,final int exDividendDays,double npv){
  final double bps=bps(leg,discountCurve,settlementDate,npvDate,exDividendDays);
  if (npv == 0) {
    npv=npv(leg,discountCurve,settlementDate,npvDate,exDividendDays);
  }
  return basisPoint_ * npv / bps;
}

public double atmRate ( final Leg leg , final Handle < YieldTermStructure > discountCurve , final Date settlementDate , final Date npvDate , final int exDividendDays , double npv ) { final double bps = bps ( leg , discountCurve , settlementDate , npvDate , exDividendDays ) ; if ( npv == 0 ) { npv = npv ( leg , discountCurve , settlementDate , npvDate , exDividendDays ) ; } return basisPoint_ * npv / bps ; }
at - the - money rate of the cash flows . < p > the result is the fixed rate for which a fixed rate cash flow vector , equivalent to the input vector , has the required npv according to the given term structure . if the required npv is not given , the input cash flow vector ' s npv is used instead .
