Exemple #1
0
        private void setScore(double methodMark, InterpolationBase intrpl)
        {
            string text = methodMark.ToString("F16");

            if (intrpl is LagrangeInterpolation)
            {
                scoreLagrageLb.Text = text;
            }
            else if (intrpl is GaussianParametricInterpolation)
            {
                var parametricIntrpl = intrpl as GaussianParametricInterpolation;
                if (parametricIntrpl.Type == ParametricType.Normal)
                {
                    scoreParamNormLb.Text = text;
                }
                else if (parametricIntrpl.Type == ParametricType.Summary)
                {
                    scoreParamSummLb.Text = text;
                }
            }
            else if (intrpl is GaussianInterpolation)
            {
                scoreGausLb.Text = text;
            }
        }
Exemple #2
0
        private PointPairList doInterpolation(InterpolationBase intrplMethod, PointPairList basisPoints)
        {
            PointPairList interpolatedPoints = new PointPairList();

            if (intrplMethod is GaussianParametricInterpolation)
            {
                var parametricIntrpl = intrplMethod as GaussianParametricInterpolation;
                for (int ti = 1; ti < basisPoints.Count; ti++)
                {
                    double prevT = parametricIntrpl.GetT(ti - 1);
                    double curT  = parametricIntrpl.GetT(ti);
                    double delta = (curT - prevT) / (pointsBetweenBasisNumber + 1);

                    // here we should put points for comperison distance beetwen each method
                    for (int pbi = 0; pbi <= pointsBetweenBasisNumber; pbi++)                       // pbi means Point Between Bassis Iter
                    {
                        interpolatedPoints.Add(parametricIntrpl.GetPoint(prevT + pbi * delta));
                    }
                }
                double    lastT     = parametricIntrpl.GetT(basisPoints.Count - 1);
                PointPair lastPoint = parametricIntrpl.GetPoint(lastT);
                interpolatedPoints.Add(lastPoint);
            }
            else
            {
                for (int xi = 1; xi < basisPoints.Count; xi++)
                {
                    double prevX = basisPoints[xi - 1].X;
                    double curX  = basisPoints[xi].X;
                    double delta = (curX - prevX) / (pointsBetweenBasisNumber + 1);
                    // here we should put points for comperison distance beetwen each method
                    for (int pbi = 0; pbi <= pointsBetweenBasisNumber; pbi++)                       // pbi means Point Between Bassis Iter
                    {
                        interpolatedPoints.Add(intrplMethod.GetPoint(prevX + pbi * delta));
                    }
                }
                double    lastX     = basisPoints[basisPoints.Count - 1].X;
                PointPair lastPoint = intrplMethod.GetPoint(lastX);
                interpolatedPoints.Add(lastPoint);
            }
            return(interpolatedPoints);
        }