private double[] SolutionsForLezandrPolynomial(int n)
        {
            MathFunction   poly   = LezandrPolynomial(n + 1);
            Equasion       eq     = new Equasion(poly, new ConstFunction(0));
            EquasionMethod method = new HalfDivision();

            double left  = -1,
                   right = -1 + 2 * epsilan;

            double[] solutions = new double[n + 1];
            int      bound     = n % 2 == 0 ? n / 2 : (n + 1) / 2;
            int      index     = 0;

            while (index < bound &&
                   left < 0)
            {
                try
                {
                    solutions[index] = method.Solve(eq, left, right);
                    left             = solutions[index] + epsilan;
                    right            = left + 2 * epsilan;
                    index++;
                } catch
                {
                    left  += 2 * epsilan;
                    right += 2 * epsilan;
                }
            }

            for (int i = 0; i < bound; i++)
            {
                solutions[n - i] = -solutions[i];
            }

            return(solutions);
        }
예제 #2
0
 public static Vector ShturmMethod(Equasion eq)
 {
     return(null);
 }
예제 #3
0
 public static int SolutionCount(Equasion eq, double a, double b)
 {
     return(0);
 }