private static decimal[] GetH_1() { var res = new decimal[2 * Parameters.M]; for (int i = 0; i < res.Length; i++) { var t = (decimal)((decimal)i * (decimal)Math.PI) / (decimal)Parameters.M; var dod1 = 2M * Parametrization_ND.X11(t) * Parametrization_ND.X12d(t) / Normal.GetModul(new[] { Parametrization_ND.X11d(t), Parametrization_ND.X12d(t) }); var dod2 = 2M * Parametrization_ND.X12(t) * Parametrization_ND.X11d(t) / Normal.GetModul(new[] { Parametrization_ND.X11d(t), Parametrization_ND.X12d(t) }); res[i] = (dod1 + dod2); } return(res); }
private decimal[] GetF1_G1(bool useNoisy) { var res = new decimal[2 * Parameters.M]; Random r = new Random(); decimal randomValue = (decimal)r.Next(0, 100) / 100M; var norma = 0.0M; for (int i = 0; i < res.Length; i++) { var t = (decimal)((decimal)i * (decimal)Math.PI) / (decimal)Parameters.M; res[i] = (decimal)(Math.Pow((double)Parametrization_ND.X11(t), 2) - Math.Pow((double)Parametrization_ND.X12(t), 2)); norma += (res[i] * res[i]); } if (useNoisy) { for (int i = 0; i < res.Length; i++) { res[i] = res[i] + Noisy * (2M * randomValue - 1M) * (decimal)Math.Sqrt((double)norma); } } return(res); }
private static decimal[] GetF1_1() { var res = new decimal[2 * Parameters.M]; for (int i = 0; i < res.Length; i++) { var t = (decimal)((decimal)i * (decimal)Math.PI) / (decimal)Parameters.M; res[i] = (decimal)(Math.Pow((double)Parametrization_ND.X11(t), 2) - Math.Pow((double)Parametrization_ND.X12(t), 2)); } return(res); }
public decimal CalculateU(decimal[] x) { decimal sum1 = 0; decimal sum2 = 0; for (int k = 0; k < 2 * Parameters.M; k++) { sum1 += destiny[k] * Kernels_ND.Fundamental(x, new[] { Parametrization_ND.X01(t[k]), Parametrization_ND.X02(t[k]) }); sum2 += destiny[k + 2 * Parameters.M] * Kernels_ND.Fundamental(x, new[] { Parametrization_ND.X11(t[k]), Parametrization_ND.X12(t[k]) }); } return((sum1 + sum2) / (2M * Parameters.M)); }