private void btnPrmElt_Click(object sender, EventArgs e) { ExtensionFieldElement prm = ExtF.RandomPrimitiveElement((new Random()).Next(1, GF56Primitive.Degree)); txtInfo.Clear(); txtInfo.AppendText("Random Primitive Element = " + prm.ToString() + "\r\n\r\n"); }
private void btnDivision_Click(object sender, EventArgs e) { ExtensionFieldElement e1 = ExtF.RandomElement; while (e1.Value.IsZero) { e1 = ExtF.RandomElement; } ExtensionFieldElement e2 = ExtF.RandomElement; while (e2.Value.IsZero) { e2 = ExtF.RandomElement; } ExtensionFieldElement q = e1 / e2; txtInfo.Clear(); txtInfo.AppendText("Random Element 1 = " + e1.ToString() + "\r\n"); txtInfo.AppendText("Random Element 2 = " + e2.ToString() + "\r\n"); txtInfo.AppendText("Division = " + q.ToString() + "\r\n"); txtInfo.AppendText("Test E1 = " + ((e2 * q) + (e1 % e2)).ToString() + "\r\n"); txtInfo.AppendText("\r\n"); }
private void btnNorm_Click(object sender, EventArgs e) { ExtensionFieldElement elt = ExtF.RandomElement; txtInfo.Clear(); txtInfo.AppendText("Random Element = " + elt.ToString() + "\r\n"); txtInfo.AppendText("Norm: " + elt.Norm.ToString() + "\r\n"); txtInfo.AppendText("\r\n"); }
private void btnMultip_Click(object sender, EventArgs e) { ExtensionFieldElement e1 = ExtF.RandomElement; ExtensionFieldElement e2 = ExtF.RandomElement; ExtensionFieldElement toplam = e1 * e2; txtInfo.Clear(); txtInfo.AppendText("Random Element 1 = " + e1.ToString() + "\r\n"); txtInfo.AppendText("Random Element 2 = " + e2.ToString() + "\r\n"); txtInfo.AppendText("Multiplication = " + toplam.ToString() + "\r\n"); txtInfo.AppendText("\r\n"); }
private void btnConjugates_Click(object sender, EventArgs e) { ExtensionFieldElement elt = ExtF.RandomElement; txtInfo.Clear(); txtInfo.AppendText("Random Element = " + elt.ToString() + "\r\n"); ExtensionFieldElement[] eltConjs = elt.Conjugates; txtInfo.AppendText("Conjugates:" + "\r\n"); for (int i = 0; i < eltConjs.Length; i++) { txtInfo.AppendText("C(" + (i + 1) + ") = " + eltConjs[i] + "\r\n"); } txtInfo.AppendText("\r\n"); }