/// <summary> /// Adapter-Target /// </summary> /// <param name="target"></param> public Adapter(Distributions target) { // Set the delegate to the existing standard //Request = (arg => target.Estimate(arg)); m_NormCdf = ((double arg) => new Distributions().NormCdf(arg)); m_Distributions = target; }
/// <summary> /// Defaults to the adaptee (the math features made by the customer). /// </summary> public Adapter() { m_Distributions = new Adaptee(); m_NormCdf = m_Distributions.NormCdf; }
// Different constructors for the expected targets/adaptees // Adapter-Adaptee // ReSharper disable UnusedParameter.Local /// <summary> /// The Adeptee feature will be altered. /// </summary> /// <param name="adaptee"></param> public Adapter(Adaptee adaptee, double dt) // ReSharper restore UnusedParameter.Local { m_NormCdf = ((double arg) => new Distributions().NormCdf(arg)); // Set the delegate to the new standard if (adaptee != null) { m_Distributions = adaptee; } }