static void Main(string[] args) { Hyperbolic<int> h = new Hyperbolic<int>(10); int[] a = Hyperbolic<int>.genRndArray(10); int[] evensOfA = Hyperbolic<int>.arrayOfEvens(a); foreach (int i in a) { System.Console.WriteLine(i); } System.Console.WriteLine("Número de pares: {0}", Hyperbolic<int>.countEvens(evensOfA)); Console.WriteLine(Hyperbolic<double>.ComposeDouble(x => Math.Exp(x), y => Math.Log(y))(3)); Console.WriteLine(Hyperbolic<double>.composeD(x => Math.Exp(x), y => Math.Log(y))(3)); Console.WriteLine(Hyperbolic<double>.composeG(x => Math.Exp(x), y=> Math.Log(y))(3)); Console.WriteLine(Hyperbolic<double>.nextChar('a')); }
//public void Initialize() //{ // this.poids.Clear(); // this.neurones.Clear(); //} public void Calculate() { double sum = 0; hyperbolic = new Hyperbolic(); foreach (var nn in neurones) { foreach (var connect in nn.dentrite) { if (connect == nn.dentrite[0]) { sum = poids[(int)connect.PoidstIndex].Value; } else { sum += poids[(int)connect.PoidstIndex].Value * (CouchePrecedente.neurones[(int)connect.NeuroneIndex].Sortie); } } nn.Sortie = hyperbolic.Fonction(sum); } }
//Отримає вибрані типи апроксимації List <FunctionSeries> checkBoxes() { List <FunctionSeries> functionList = new List <FunctionSeries>(); if (checkBox1.Checked) { functionList.RemoveAll(o => o.Title == rm.GetString("Linear")); Linear linear = new Linear(x, y); Graph.graphList.Add(linear); functionList.Add(new FunctionSeries(linear.function, x.Min(), x.Max(), 0.0001, rm.GetString("Linear"))); } else { functionList.RemoveAll(o => o.Title == rm.GetString("Linear")); } if (checkBox2.Checked) { functionList.RemoveAll(o => o.Title == rm.GetString("Quadratic")); Quadratic quadratic = new Quadratic(x, y); Graph.graphList.Add(quadratic); functionList.Add(new FunctionSeries(quadratic.function, x.Min(), x.Max(), 0.0001, rm.GetString("Quadratic"))); } else { functionList.RemoveAll(o => o.Title == rm.GetString("Quadratic")); } if (checkBox3.Checked) { functionList.RemoveAll(o => o.Title == rm.GetString("Cubic")); Cubic cubic = new Cubic(x, y); Graph.graphList.Add(cubic); functionList.Add(new FunctionSeries(cubic.function, x.Min(), x.Max(), 0.0001, rm.GetString("Cubic"))); } else { functionList.RemoveAll(o => o.Title == rm.GetString("Cubic")); } if (checkBox4.Checked) { functionList.RemoveAll(o => o.Title == rm.GetString("Power")); Power power = new Power(x, y); Graph.graphList.Add(power); functionList.Add(new FunctionSeries(power.function, x.Min(), x.Max(), 0.0001, rm.GetString("Power"))); } else { functionList.RemoveAll(o => o.Title == rm.GetString("Power")); } if (checkBox5.Checked) { functionList.RemoveAll(o => o.Title == rm.GetString("abExponential")); abExponential abexpo = new abExponential(x, y); Graph.graphList.Add(abexpo); functionList.Add(new FunctionSeries(abexpo.function, x.Min(), x.Max(), 0.0001, rm.GetString("abExponential"))); } else { functionList.RemoveAll(o => o.Title == rm.GetString("abExponential")); } if (checkBox6.Checked) { functionList.RemoveAll(o => o.Title == rm.GetString("Logarithmic")); Logarithmic logarithmic = new Logarithmic(x, y); Graph.graphList.Add(logarithmic); functionList.Add(new FunctionSeries(logarithmic.function, x.Min(), x.Max(), 0.0001, rm.GetString("Logarithmic"))); } else { functionList.RemoveAll(o => o.Title == rm.GetString("Logarithmic")); } if (checkBox7.Checked) { functionList.RemoveAll(o => o.Title == rm.GetString("Hyperbolic")); Hyperbolic hyperbolic = new Hyperbolic(x, y); Graph.graphList.Add(hyperbolic); functionList.Add(new FunctionSeries(hyperbolic.function, x.Min(), x.Max(), 0.0001, rm.GetString("Hyperbolic"))); } else { functionList.RemoveAll(o => o.Title == rm.GetString("Hyperbolic")); } if (checkBox8.Checked) { functionList.RemoveAll(o => o.Title == rm.GetString("Exponential")); Exponential exponential = new Exponential(x, y); Graph.graphList.Add(exponential); functionList.Add(new FunctionSeries(exponential.function, x.Min(), x.Max(), 0.0001, rm.GetString("Exponential"))); } else { functionList.RemoveAll(o => o.Title == rm.GetString("Exponential")); } return(functionList); }