CanvasClean.LoessInterpolator.LoessModel.FindInterval C# (CSharp) Méthode

FindInterval() private méthode

private FindInterval ( double x ) : LoessInterval
x double
Résultat LoessInterval
            private LoessInterval FindInterval(double x)
            {
                int iLeft = 0, iRight = LoessIntervals.Count - 1;
                while (iLeft <= iRight)
                {
                    int iMid = (iLeft + iRight) / 2;
                    if (LoessIntervals[iMid].IsRightOf(x))
                    {
                        iRight = iMid - 1;
                    }
                    else if (LoessIntervals[iMid].IsLeftOf(x))
                    {
                        iLeft = iMid + 1;
                    }
                    else
                    {
                        return LoessIntervals[iMid];
                    }
                }

                return null;
            }