/// <summary>Creates a specific grid point curve factory. /// </summary> /// <typeparam name="TLabel">The type of the label.</typeparam> /// <param name="curveInterpolator">The curve interpolator.</param> /// <param name="leftExtrapolator">The extrapolator on the left side, i.e. from the first grid point to -\infinity.</param> /// <param name="rightExtrapolator">The extrapolator on the right side, i.e. from the last grid point to \infinity.</param> /// <returns>A factory for <see cref="IGridPointCurve<TLabel>"/> objects with respect to the desired interpolation and extrapolation approaches.</returns> public static IGridPointCurveFactory <TLabel> Create <TLabel>(GridPointCurve.Interpolator curveInterpolator, GridPointCurve.Extrapolator leftExtrapolator, GridPointCurve.Extrapolator rightExtrapolator) where TLabel : IEquatable <TLabel> { return(new CurveFactory <TLabel>( () => GridPointCurve.Create <TLabel>(curveInterpolator, leftExtrapolator, rightExtrapolator), curveInterpolator, (gridPointCount, gridPointLabels, gridPointArguments, gridPointValues, gridPointArgumentStartIndex, gridPointValueStartIndex, gridPointArgumentIncrement, gridPointValueIncrement) => { return GridPointCurve.Create(curveInterpolator, leftExtrapolator, rightExtrapolator, gridPointCount, gridPointLabels, gridPointArguments, gridPointValues, gridPointArgumentStartIndex, gridPointValueStartIndex, gridPointArgumentIncrement, gridPointValueIncrement); })); }
/// <summary>Initializes a new instance of the <see cref="StandardGridPointCurveNoLabels"/> class. /// </summary> /// <param name="curveInterpolatorFactory">The curve interpolator factory.</param> /// <param name="curveInterpolator">The curve interpolator.</param> /// <param name="leftExtrapolatorFactory">The left extrapolator factory.</param> /// <param name="leftExtrapolator">The left extrapolator.</param> /// <param name="rightExtrapolatorFactory">The right extrapolator factory.</param> /// <param name="rightExtrapolator">The right extrapolator.</param> /// <param name="capacity">The number of elements that the new grid point curve can initially store.</param> internal StandardGridPointCurveNoLabels(GridPointCurve.Interpolator curveInterpolatorFactory, ICurveDataFitting curveInterpolator, GridPointCurve.Extrapolator leftExtrapolatorFactory, ICurveExtrapolator leftExtrapolator, GridPointCurve.Extrapolator rightExtrapolatorFactory, ICurveExtrapolator rightExtrapolator, int capacity = 20) { m_GridPointArguments = new List<double>(capacity); m_GridPointValues = new List<double>(capacity); m_CurveBuilder = curveInterpolator; m_LeftExtrapolator = leftExtrapolator; m_RightExtrapolator = rightExtrapolator; m_State = GridPointCurve.State.GridPointChanged; m_ReadOnlyGridPointValues = new ReadOnlyCollection<double>(m_GridPointValues); m_ReadOnlyGridPointArguments = new ReadOnlyCollection<double>(m_GridPointArguments); }
/// <summary>Initializes a new instance of the <see cref="Differentiable"/> class. /// </summary> /// <param name="curveInterpolatorFactory">The curve interpolator factory.</param> /// <param name="curveInterpolator">The curve interpolator.</param> /// <param name="leftExtrapolatorFactory">The left extrapolator factory.</param> /// <param name="leftExtrapolator">The left extrapolator.</param> /// <param name="rightExtrapolatorFactory">The right extrapolator factory.</param> /// <param name="rightExtrapolator">The right extrapolator.</param> /// <param name="capacity">The number of elements that the new grid point curve can initially store.</param> internal Differentiable(GridPointCurve.Interpolator curveInterpolatorFactory, ICurveDataFitting curveInterpolator, GridPointCurve.Extrapolator leftExtrapolatorFactory, ICurveExtrapolator leftExtrapolator, GridPointCurve.Extrapolator rightExtrapolatorFactory, ICurveExtrapolator rightExtrapolator, int capacity) : base(curveInterpolatorFactory, curveInterpolator, leftExtrapolatorFactory, leftExtrapolator, rightExtrapolatorFactory, rightExtrapolator, capacity) { }