public double CalculateExponential(InterpolationSet set) { ValidateSet(set); return(CalculateExponential( set.PreviousPoint.BusinessDays, set.PreviousPoint.Rate, set.NextPoint.BusinessDays, set.NextPoint.Rate, set.TargetMaturityDays )); }
private void ValidateSet(InterpolationSet set) { if (set.PreviousPoint.BusinessDays > set.NextPoint.BusinessDays) { throw new ArgumentOutOfRangeException($"Previous business days can not be greater than next business days. Previous: {set.PreviousPoint.BusinessDays}. Next: {set.NextPoint.BusinessDays}"); } if (set.PreviousPoint.BusinessDays > set.TargetMaturityDays || set.NextPoint.BusinessDays < set.TargetMaturityDays) { throw new ArgumentOutOfRangeException($"Target maturity days is not in the allowed range. Previous: {set.PreviousPoint.BusinessDays}. Next: {set.NextPoint.BusinessDays}. Target: {set.TargetMaturityDays}"); } }