Пример #1
0
        static void FireInDaHole(int[] chms, int my_index)
        {
            for (int i = -chms[my_index]; i <= chms[my_index]; i++)
            {
                RecursionsCycles[my_index] = i;

                if (my_index == chms.Length - 1) //запустили последний цикл
                {
                    double test = iF0;           // + i * iF[0] + j * iF[1] + t * iF[2];
                    for (int k = 0; k < RecursionsCycles.Length; k++)
                    {
                        test += RecursionsCycles[k] * iF[k];
                    }

                    if (test < f_min || test > f_max)
                    {
                        continue;
                    }

                    int p = (int)(iS.Length * (/*iF0 + i * iF[0] + j * iF[1] + t * iF[2]*/ test - f_min) / (f_max - f_min));

                    double bs = ampl;
                    for (int k = 0; k < RecursionsCycles.Length; k++)
                    {
                        bs *= Bessel.bessel(RecursionsCycles[k], iindex[k]);
                    }
                    iS[p] += bs; // + ampl * Bessel.bessel(i, iindex[0]) * Bessel.bessel(j, iindex[1]) * Bessel.bessel(t, iindex[2]);

                    if (System.Math.Abs(iS[p]) > S_max)
                    {
                        S_max = System.Math.Abs(iS[p]);
                    }
                    if (System.Math.Abs(iS[p]) < S_min)
                    {
                        S_min = System.Math.Abs(iS[p]);
                    }
                }
                else
                {
                    FireInDaHole(chms, my_index + 1);
                }
            }
        }