Пример #1
0
        public float[] buscandoFxResuelto(float[] xArray, float[] yArray)
        {
            int size = xArray.Length;

            Procesamiento_de_datos.BuscarPolinomio buscar = new BuscarPolinomio();

            String lagrangePolynomial = "";

            float[] polAcumulado = new float[1];
            polAcumulado[0] = 0;

            float valorYSobreLX = 0;

            for (int i = 0; i < size; i++)
            {
                float   y   = yArray[i];
                float[] res = new float[1];
                res[0]        = 0;
                valorYSobreLX = paraBuscarFx(xArray, i, y);
                for (int j = 0; j < 1; j++)
                {
                    res = obtenerPolinomioDeLx(xArray, i, res);
                }
                res          = buscar.multiplicarPolinomioXY(res, valorYSobreLX);
                polAcumulado = buscar.sumarPolinomios(res, polAcumulado);

                /*                 lagrangePolynomial =
                 *               lagrangePolynomial + paraBuscarFx(xArray, i, y).ToString() +
                 *               obtenerLasXs(xArray, i);
                 */
            }
            return(polAcumulado);
        }
Пример #2
0
        public float[] buscandoFxResueltoProgresivo(float[] x, float[] datosDeY)
        {
            Procesamiento_de_datos.BuscarPolinomio buscar = new BuscarPolinomio();
            String devolver = "";

            float[,] y = obtenerTablaDeDiferenciasDivididas(x, crearTabla(datosDeY), x.Length);
            int tamanio = datosDeY.Length - 1;

            devolver = y[0, 0].ToString();
            float[] cuentas = new float[1];
            cuentas[0] = 0;
            for (int i = 0; i < x.Length; i++)
            {
                //      if (i > 1)
                //      {
                float[] temporal = multiplicarTodosPor(protermFloat(i, x), y[0, i]);
                cuentas = buscar.sumarPolinomios(temporal, cuentas);

                /*        }
                 *      else
                 *      {
                 *          cuentas = multiplicarTodosPor(protermFloat(i, x), y[0, i]);
                 *      }*/
            }
            return(cuentas);
        }