示例#1
0
        public static Vector SimpleInterpolate(Vector y_knots, Grid grid, int deg)
        {
            if (deg == 2)
            {
                return(y_knots);
            }
            int    p     = grid.SplineDegree;
            int    N     = grid.Count - 2 * (p - 1) - 2 * (p - 2);
            Matrix A     = new Matrix(N);
            Vector coefs = new Vector();

            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j < N; j++)
                {
                    A[i, j] = DeBoorMethods.SimpleDeBoorB(grid.GetOrigin(i), grid, deg, j + p - 1);
                }
            }

            if (A.Length.n < 15)
            {
                Console.WriteLine(A);
            }

            coefs = Solver.BCGSTAB(A, y_knots, EPS);

            return(coefs);
        }