public PaymentInfo[] Visit(AutoCall autocall) { var underlyingPayments = autocall.Underlying.Accept(this); var redemptionPayments = autocall.CallDates.Map(d => autocall.Redemption(d).Accept(this)); return(redemptionPayments.Aggregate(underlyingPayments, (prev, d) => prev.Union(d).ToArray())); }
public IFixing[] Visit(AutoCall autocall) { var underlyingFixings = autocall.Underlying.Accept(this); var redemptionFixings = autocall.CallDates.Map(d => autocall.Redemption(d).Accept(this)); var triggerFixings = autocall.CallDates.Map(d => autocall.CallTrigger(d).Fixings); var mergedFixings = underlyingFixings.MergeWith(redemptionFixings) .MergeWith(triggerFixings); return(mergedFixings.OrderBy(f => f.Date).ToArray()); }
public DateTime[] Visit(AutoCall autocall) { var underlyingDates = autocall.Underlying.Accept(this); var redemptionDates = autocall.CallDates.Map(d => autocall.Redemption(d).Accept(this)); var result = EnumerableUtils.Merge(redemptionDates); result = EnumerableUtils.Merge(underlyingDates, result); result = EnumerableUtils.Merge(result, autocall.CallDates); result = result.OrderBy(d => d).ToArray(); return(result); }