static void TestSort() { double[][] A = new double[][] { new double[] { 4, -4, 4, 2 }, new double[] { 2, 2, 2, -3 }, new double[] { -3, 2, -3, 1 }, new double[] { -1, -2, 2, 4 }, }; double[] B = new double[] { -5, -2, 0, 4 }; try { double[] result = MyAlgorithm.Gauss(A, B); for (int i = 0; i < A.Length; i++) { for (int j = 0; j < A[i].Length; j++) { Console.Write(A[i][j] + " "); } Console.Write("| " + B[i] + " | " + result[i]); Console.WriteLine(); } } catch (ArgumentException e) { Console.WriteLine(e.Message); } }
private void Form1_Load(object sender, EventArgs e) { lblStatusContract.Text = ""; lblStatusB.Text = ""; lblStatusA.Text = ""; lblStatusBinary.Text = ""; _alg = new MyAlgorithm(); }
private void btnGenerate_Click(object sender, EventArgs e) { if (!Int32.TryParse(txtProduct.Text, out product)) { MessageBox.Show("Please input & correct the Product"); return; } if (!Int32.TryParse(txtPlayer.Text, out player)) { MessageBox.Show("Please input & correct the Player"); return; } remoteFactory = new ChannelFactory <IService1>("ServiceConfig"); _alg = new MyAlgorithm(product, player, product); UpdateStatus(0, "Created"); UpdateStatus(1, "Created"); UpdateStatus(2, "Created"); UpdateStatus(3, "Created"); UpdateStatus(4, "Created"); UpdateStatus(5, "Created"); }
public void TestNewton() { Assert.AreEqual(4.907, MyAlgorithm.Newton(MyAlgorithm.Func, MyAlgorithm.dFunc, MyAlgorithm.ddFunc, 2, 6, 0.000000001), 0.001); }
public void initTest() { MyAlgorithm al = new MyAlgorithm(); }