Ejemplo n.º 1
0
 public void RunApproximation_resultArray_WithoutNull(string _polynome)
 {
     data3D     = new Data3D(readTransformData.oneDimArrayX1, readTransformData.oneDimArrayY1, readTransformData.resultArray_WithoutNull);
     values     = new Values(Convert.ToInt32(_polynome), data3D.arrayX.Length, data3D.arrayY.Length);
     findValues = new FindValues_xa_yb_c(Convert.ToInt32(_polynome), data3D, values);
     values.assignListArray(values.listArrayResult);
 }
Ejemplo n.º 2
0
 public void RunApproximation_resultArray_Approx(string _polynome)
 {
     data3D = new Data3D(readTransformData.oneDimArrayX1, readTransformData.oneDimArrayY1, readTransformData.resultArray_Approx);
     // Console.WriteLine($"{data3D.arrayX.Length} {data3D.arrayY.Length}");
     values     = new Values(Convert.ToInt32(_polynome), data3D.arrayX.Length, data3D.arrayY.Length);
     findValues = new FindValues_xa_yb_c(Convert.ToInt32(_polynome), data3D, values);
     values.assignListArray(values.listArrayResult);
 }
Ejemplo n.º 3
0
 public void RunSwapApproximation(string _polynome, bool key)
 {
     if (key)
     {
         data3DInverted     = new Data3D(readTransformData.oneDimArrayY1, readTransformData.oneDimArrayX1, readTransformData.invertedArray_WithoutNull);
         valuesInverted     = new Values(Convert.ToInt32(_polynome), data3DInverted.arrayY.Length, data3DInverted.arrayX.Length);
         findValuesInverted = new FindValues_xa_yb_c(Convert.ToInt32(_polynome), data3DInverted, valuesInverted);
         valuesInverted.assignListArray(valuesInverted.listArrayResult);
     }
     else
     {
         data3DInverted     = new Data3D(readTransformData.oneDimArrayY1, readTransformData.oneDimArrayX1, readTransformData.invertedArray_Approx);
         valuesInverted     = new Values(Convert.ToInt32(_polynome), data3DInverted.arrayX.Length, data3DInverted.arrayY.Length);
         findValuesInverted = new FindValues_xa_yb_c(Convert.ToInt32(_polynome), data3DInverted, valuesInverted);
         valuesInverted.assignListArray(valuesInverted.listArrayResult);
     }
 }
        List <double> approximationResultArray(List <double> _resultArray, List <double> _oneDimArrayX1, List <double> _oneDimArrayY1, int _Draw, int _n, ref double _R)
        {
            int                l             = 0;
            List <double>      resApprox     = new List <double>();
            List <double>      tempList      = new List <double>();
            List <double>      listResTemp   = new List <double>();
            List <double>      listArrX1Temp = new List <double>();
            List <double>      listArrY1Temp = new List <double>();
            Data3D             data3D;
            Values             values;
            FindValues_xa_yb_c findValues;
            int                a = 0;

            listArrY1Temp.Add(_oneDimArrayY1[a]);
            for (int i = 0; i < _resultArray.Count; i++)
            {
                if (l == _Draw / 2)
                {
                    data3D     = new Data3D(listArrX1Temp, listArrY1Temp, tempList);
                    values     = new Values(_n, data3D.arrayX.Length, data3D.arrayY.Length);
                    findValues = new FindValues_xa_yb_c(_n, data3D, values);
                    int j = 0;
                    foreach (var item in listResTemp)
                    {
                        if (item <= 0)
                        {
                            findValues.findMassiveYwithX(_oneDimArrayX1[j], _n);
                            resApprox.Add(values.findYMassiveWithX[0]);
                        }
                        else
                        {
                            resApprox.Add(item);
                        }
                        j++;
                    }

                    l = 0;
                    tempList.Clear();
                    listResTemp.Clear();
                    listArrX1Temp.Clear();
                    listArrY1Temp.Clear();
                    a++;
                    listArrY1Temp.Add(_oneDimArrayY1[a]);
                }

                if (_resultArray[i] > 0)
                {
                    tempList.Add(_resultArray[i]);
                    listArrX1Temp.Add(_oneDimArrayX1[l]);
                }
                listResTemp.Add(_resultArray[i]);
                l++;
            }

            data3D     = new Data3D(listArrX1Temp, listArrY1Temp, tempList);
            values     = new Values(_n, data3D.arrayX.Length, data3D.arrayY.Length);
            findValues = new FindValues_xa_yb_c(_n, data3D, values);
            int k = 0;

            foreach (var item in listResTemp)
            {
                if (item <= 0)
                {
                    findValues.findMassiveYwithX(_oneDimArrayX1[k], _n);
                    resApprox.Add(values.findYMassiveWithX[0]);
                }
                else
                {
                    resApprox.Add(item);
                }
                k++;
            }

            data3D     = new Data3D(_oneDimArrayX1, _oneDimArrayY1, _resultArray);
            values     = new Values(_n, data3D.arrayX.Length, data3D.arrayY.Length);
            findValues = new FindValues_xa_yb_c(_n, data3D, values);
            _R         = findValues.findRWithList(resultArray_WithoutNull, resApprox);
            return(resApprox);
        }