Beispiel #1
0
        public static void execute(Form1 form, List <UserControl> userControls, List <DrawLine> drawedLines)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            ILoad load;

            openFileDialog.Filter = FORMATS;
            string filePath;

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                filePath = openFileDialog.FileName;
                load     = new LoadXml();

                if (".xml".Equals(filePath.Substring(filePath.Length - 4)))
                {
                    load = new LoadXml();
                }

                else if (".json".Equals(filePath.Substring(filePath.Length - 5)))
                {
                    load = new LoadJSON();
                }
                else if (".bmp".Equals(filePath.Substring(filePath.Length - 4)))
                {
                    load = new LoadBmp();
                }
                else
                {
                    throw new InvalidDataException();
                }
                RecoverContext.recovery(form, load.execute(filePath));
            }
        }
Beispiel #2
0
    public void UpdateCardDisplay(params object[] args)
    {
        string cardID = (string)args[0];

        if (cardID == "0" || cardID == "")
        {
            return;
        }
        XmlCard card = LoadXml.GetXmlCard(cardID);
        string  star = "";

        rawImage.texture = StaticMethod.GetCardPics(cardID, false);
        effectText.text  = card.cardDescribe;
        nameText.text    = "[" + card.cardName.ToString() + "]" + "\n";

        nameText.text += "[" + card.cardType + "]";
        if (card.IsMonster())
        {
            for (int i = 0; i < card.level; i++)
            {
                star = star + "★";
            }
            nameText.text += "  " + card.race + "/" + card.attribute + "\n";
            nameText.text += "[" + star + "]" + "   " + card.afk + "/" + card.def;
        }
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        wedding = LoadXml.LoadXmlFile();

        audioSource.Play();

        currentScene = wedding.getScenes().Find(x => x.getCode() == "ST");
    }
    // Use this for initialization
    void Start()
    {
        map.SetActive(false);

        wedding = LoadXml.LoadXmlFile();

        currentScene = wedding.getScenes().Find(x => (x.getCode() == "C2d") && (x.getSubCode() == "#1"));
    }
Beispiel #5
0
    // Use this for initialization
    void Start()
    {
        map.SetActive(false);

        wedding = LoadXml.LoadXmlFile();

        currentScene = wedding.getScenes().Find(x => x.getCode() == "D3");
    }
Beispiel #6
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_4_7.xml");
            if (isRegeneration)
            {
                this.a1 = this.numberTools.myRandom(9);
                this.a2 = this.numberTools.myRandom(9);
                this.a3 = this.numberTools.myRandom(9);
                this.b1 = this.numberTools.myRandom(9);
                this.b2 = this.numberTools.myRandom(9);
                this.b3 = this.numberTools.myRandom(9);
                this.b4 = this.numberTools.myRandom(9);
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Params_Cal_4_7.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a1")
                        {
                            this.a1 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a2")
                        {
                            this.a2 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a3")
                        {
                            this.a3 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b1")
                        {
                            this.b1 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b2")
                        {
                            this.b2 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b3")
                        {
                            this.b3 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b4")
                        {
                            this.b4 = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }

            Console.WriteLine("x=(" + this.b1.ToString() + "," + this.b2.ToString() + "," + this.b3.ToString() + "," + this.b4.ToString() + ")T+k(" + this.a1.ToString() + "," + this.a2.ToString() + "," + this.a3.ToString() + "-1)T");
        }
    // Use this for initialization
    void Start()
    {
        map.SetActive(false);

        wedding = LoadXml.LoadXmlFile();

        audioSource.Play();

        currentScene = wedding.getScenes().Find(x => x.getCode() == "DJ2a1");
    }
Beispiel #8
0
    public static Card GenerateCard(string id)
    {
        Card card   = LoadXml.GetCard(id);
        Card result = new Card(card.cardID, card.cardName, card.cardDescribe, card.cardType);

        if (card.IsMonster())
        {
            result.SetMonsterAttribute(card.attribute, card.race, card.level, card.afk, card.def);
        }
        return(result);
    }
    /// <summary>
    /// 卡片描述 \n ★
    /// </summary>
    public void SetText(string id)
    {
        XmlCard card = LoadXml.GetXmlCard(id);

        theText.text  = "";
        theText.text += card.cardName + "\n";
        if (card.IsMonster())
        {
            theText.text += card.afk.ToString() + "/" + card.def.ToString() + "\n";
            theText.text += card.attribute + "/" + card.race + "  " + "★" + card.level.ToString();
        }
        else
        {
            theText.text += card.cardType;
        }
    }
Beispiel #10
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_5_4.xml");
            if (!isRegeneration)
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_5_4.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a")
                        {
                            this.a = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b")
                        {
                            this.b = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            this.fMb = -this.b;
            this.Ta  = this.a;
            string ans = "";

            ans += "λ1=";
            ans += "0".ToString();
            ans += " ";
            ans += "λ2=";
            ans += "0".ToString();
            ans += " ";
            ans += "λ3=";
            ans += a.ToString();
            ans += " ";
            ans += "λ4=";
            ans += b.ToString();
            ans += "\r\n";
            Console.Write(ans);
        }
Beispiel #11
0
    void Awake()
    {
        LoadXml.LoadTheXml();
        uiList = new List <BaseUI>();

        duelFieldUI = Resources.Load("Prefebs/DuelFieldUI") as GameObject;
        prepareUI   = Resources.Load("Prefebs/PrepareUI") as GameObject;

        editCardUI = EditUI.GetInstance();
        editCardUI.SetName(ComStr.UI_EditCardUI);
        loginUI = LoginUI.GetInstance();
        loginUI.SetName(ComStr.UI_LoginUI);
        gameHallUI = GameHallUI.GetInstance();
        gameHallUI.SetName(ComStr.UI_GameHallUI);


        uiList.Add(editCardUI);
        uiList.Add(loginUI);
        uiList.Add(gameHallUI);
    }
Beispiel #12
0
    /// <summary>
    /// 查找卡片
    /// </summary>
    /// <param name="cardType"></param>
    /// <param name="cardAttr"></param>
    /// <param name="cardRace"></param>
    /// <param name="cardLevel"></param>
    /// <param name="keyWord"></param>
    public void FindCard(int cardType, int cardAttr, int cardRace, int cardLevel, string keyWord)
    {
        List <string> list = new List <string>();

        list = LoadXml.SearchCard(cardType, cardAttr, cardRace, cardLevel, keyWord);

        List <Card> cardList = new List <Card>();

        foreach (var item in list)
        {
            cardList.Add(LoadXml.GetCard(item));
        }
        cardList = Group.SortCardList(cardList);

        list = new List <string>();
        for (int i = 0; i < cardList.Count; i++)
        {
            list.Add(cardList[i].cardID);
        }
        searchResultCardUI.ShowSearchCard(list);
    }
Beispiel #13
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_6_1_2.xml");
            if (isRegeneration)
            {
                this.a1     = this.random.Next(-3, 0);
                this.a2     = this.random.Next(-3, 0);
                this.a3     = this.random.Next(-3, 0);
                this.b1     = this.random.Next(-2, 3);
                this.b2     = this.random.Next(-2, 3);
                this.b3     = this.random.Next(-2, 3);
                this.a11    = this.a1;
                this.a12    = (2 * this.a1) * this.b1;
                this.a13    = (2 * this.a1) * this.b2;
                this.a22    = ((this.a1 * this.b1) * this.b1) + this.a2;
                this.a23    = 2 * (((this.a1 * this.b1) * this.b2) + (this.a2 * this.b3));
                this.a33    = (((this.a1 * this.b2) * this.b2) + ((this.a2 * this.b3) * this.b3)) + this.a3;
                this.aa     = this.a11;
                this.bb     = this.a22;
                this.cc     = this.a33;
                this.Aab    = this.a12 / 2;
                this.Aac    = this.a13 / 2;
                this.Abc    = this.a23 / 2;
                this.a1a2   = this.a1 * this.a2;
                this.a1a2a3 = (this.a1 * this.a2) * this.a3;
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_6_1_2.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a1")
                        {
                            this.a1 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a2")
                        {
                            this.a2 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a3")
                        {
                            this.a3 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b1")
                        {
                            this.b1 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b2")
                        {
                            this.b2 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b3")
                        {
                            this.b3 = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            this.a11    = this.a1;
            this.a12    = (2 * this.a1) * this.b1;
            this.a13    = (2 * this.a1) * this.b2;
            this.a22    = ((this.a1 * this.b1) * this.b1) + this.a2;
            this.a23    = 2 * (((this.a1 * this.b1) * this.b2) + (this.a2 * this.b3));
            this.a33    = (((this.a1 * this.b2) * this.b2) + ((this.a2 * this.b3) * this.b3)) + this.a3;
            this.aa     = this.a11;
            this.bb     = this.a22;
            this.cc     = this.a33;
            this.Aab    = this.a12 / 2;
            this.Aac    = this.a13 / 2;
            this.Abc    = this.a23 / 2;
            this.a1a2   = this.a1 * this.a2;
            this.a1a2a3 = (this.a1 * this.a2) * this.a3;

            string ans = "";

            ans += "(1) A=\r\n";
            ans += aa.ToString() + " " + Aab.ToString() + " " + Aac.ToString() + "\r\n";
            ans += Aab.ToString() + " " + bb.ToString() + " " + Abc.ToString() + "\r\n";
            ans += Aac.ToString() + " " + Abc.ToString() + " " + cc.ToString() + "\r\n";
            ans += "(2) 负定\r\n";
            Console.Write(ans);
        }
Beispiel #14
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_7_5_1.xml");
            if (isRegeneration)
            {
                this.a12 = this.numberTools.myRandom(5);
                this.a13 = this.numberTools.myRandom(5);
                this.a14 = this.numberTools.myRandom(5);
                this.a21 = this.numberTools.myRandom(5);
                this.a23 = this.numberTools.myRandom(5);
                this.a24 = this.numberTools.myRandom(5);
                while ((this.m * this.k) == (this.n * this.h))
                {
                    this.m = this.numberTools.myRandom(3);
                    this.n = this.numberTools.myRandom(3);
                    this.h = this.numberTools.myRandom(3);
                    this.k = this.numberTools.myRandom(3);
                }
                this.a22 = (this.a21 * this.a12) + 1;
                this.a32 = (this.a31 * this.a12) + 1;
                this.a31 = (this.m * this.a11) + (this.n * this.a21);
                this.a32 = (this.m * this.a12) + (this.n * this.a22);
                this.a33 = (this.m * this.a13) + (this.n * this.a23);
                this.a34 = (this.m * this.a14) + (this.n * this.a24);
                this.a41 = (this.h * this.a11) + (this.k * this.a21);
                this.a42 = (this.h * this.a12) + (this.k * this.a22);
                this.a43 = (this.h * this.a13) + (this.k * this.a23);
                this.a44 = (this.h * this.a14) + (this.k * this.a24);
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_7_5_1.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a11")
                        {
                            this.a11 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a12")
                        {
                            this.a12 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a13")
                        {
                            this.a13 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a14")
                        {
                            this.a14 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a21")
                        {
                            this.a21 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a23")
                        {
                            this.a23 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a24")
                        {
                            this.a24 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "m")
                        {
                            this.m = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "n")
                        {
                            this.n = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "h")
                        {
                            this.h = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "k")
                        {
                            this.k = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            this.a22 = (this.a21 * this.a12) + 1;
            this.a32 = (this.a31 * this.a12) + 1;
            this.a31 = (this.m * this.a11) + (this.n * this.a21);
            this.a32 = (this.m * this.a12) + (this.n * this.a22);
            this.a33 = (this.m * this.a13) + (this.n * this.a23);
            this.a34 = (this.m * this.a14) + (this.n * this.a24);
            this.a41 = (this.h * this.a11) + (this.k * this.a21);
            this.a42 = (this.h * this.a12) + (this.k * this.a22);
            this.a43 = (this.h * this.a13) + (this.k * this.a23);
            this.a44 = (this.h * this.a14) + (this.k * this.a24);
            this.keys.Add("aab", this.a12.ToString());
            this.keys.Add("aac", this.a13.ToString());
            this.keys.Add("aad", this.a14.ToString());
            this.keys.Add("aba", this.a21.ToString());
            this.keys.Add("abb", this.a22.ToString());
            this.keys.Add("abc", this.a23.ToString());
            this.keys.Add("abd", this.a24.ToString());
            this.keys.Add("aca", this.a31.ToString());
            this.keys.Add("acb", this.a32.ToString());
            this.keys.Add("acc", this.a33.ToString());
            this.keys.Add("acd", this.a34.ToString());
            this.keys.Add("ada", this.a41.ToString());
            this.keys.Add("adb", this.a42.ToString());
            this.keys.Add("adc", this.a43.ToString());
            this.keys.Add("add", this.a44.ToString());
            this.keys.Add("bbc", (this.a23 - (this.a21 * this.a13)).ToString());
            this.keys.Add("bbd", (this.a24 - (this.a21 * this.a14)).ToString());
            this.keys.Add("bcb", (this.a32 - (this.a31 * this.a12)).ToString());
            this.keys.Add("bcc", (this.a33 - (this.a31 * this.a13)).ToString());
            this.keys.Add("bcd", (this.a34 - (this.a31 * this.a14)).ToString());
            this.keys.Add("bdb", (this.a42 - (this.a41 * this.a12)).ToString());
            this.keys.Add("bdc", (this.a43 - (this.a41 * this.a13)).ToString());
            this.keys.Add("bdd", (this.a44 - (this.a41 * this.a14)).ToString());

            string ans = "";

            ans += "维数是:2;一组基是:α1,α2.\r\n";
            Console.Write(ans);
        }
Beispiel #15
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_7_1.xml");
            if (isRegeneration)
            {
                this.b = this.numberTools.myRandom(3);
                this.c = this.numberTools.myRandom(3);
                this.d = this.numberTools.myRandom(3);
                this.e = this.numberTools.myRandom(3);
                this.a = this.random.Next(0, 2);
                this.f = this.random.Next(0, 2);
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_7_1.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a")
                        {
                            this.a = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b")
                        {
                            this.b = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c")
                        {
                            this.c = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "d")
                        {
                            this.d = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "e")
                        {
                            this.e = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "f")
                        {
                            this.f = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }

            string ans = "";

            if ((this.a == 0) && (this.f == 0))
            {
                ans += "是.\r\n";
            }
            else
            {
                ans += "不是.\r\n";
            }
            Console.Write(ans);
        }
Beispiel #16
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_7_10.xml");
            if (isRegeneration)
            {
                this.a = this.numberTools.myRandom(7);
                this.b = this.numberTools.myRandom(7);
                this.c = this.numberTools.myRandom(7);
                this.d = this.numberTools.myRandom(7);
                this.e = this.numberTools.myRandom(7);
                this.f = this.numberTools.myRandom(7);
                this.m = this.numberTools.myRandom(7);
                this.n = this.numberTools.myRandom(7);
                this.k = this.numberTools.myRandom(7);
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_7_10.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a")
                        {
                            this.a = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b")
                        {
                            this.b = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c")
                        {
                            this.c = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "d")
                        {
                            this.d = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "e")
                        {
                            this.e = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "f")
                        {
                            this.f = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "m")
                        {
                            this.m = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "n")
                        {
                            this.n = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "k")
                        {
                            this.k = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            while ((this.a11 = ((this.m * this.a) + (this.n * this.b)) + (this.k * this.d)) == 0)
            {
                this.m   = -this.m;
                this.a11 = ((this.m * this.a) + (this.n * this.b)) + (this.k * this.d);
            }
            while ((this.a12 = (this.n * this.c) + (this.k * this.e)) == 0)
            {
                this.n   = -this.n;
                this.a12 = (this.n * this.c) + (this.k * this.e);
            }
            this.a13 = this.k * this.f;
            this.keys.Add("aaa", this.a.ToString());
            this.keys.Add("aab", this.b.ToString());
            this.keys.Add("aac", this.c.ToString());
            this.keys.Add("aad", this.d.ToString());
            this.keys.Add("aae", this.e.ToString());
            this.keys.Add("aaf", this.f.ToString());
            this.keys.Add("baa", this.a11.ToString());
            this.keys.Add("bab", this.a12.ToString());
            this.keys.Add("bac", this.a13.ToString());
            this.keys.Add("caa", ((this.a * this.c) * this.f).ToString());
            this.keys.Add("daa", (this.c * this.f).ToString());
            this.keys.Add("dab", (-this.b * this.f).ToString());
            this.keys.Add("dac", ((this.b * this.e) - (this.c * this.d)).ToString());
            this.keys.Add("dbb", (this.a * this.f).ToString());
            this.keys.Add("dbc", (-this.a * this.e).ToString());
            this.keys.Add("dcc", (this.a * this.c).ToString());
            this.keys.Add("eaa", this.m.ToString());
            this.keys.Add("eab", this.n.ToString());
            this.keys.Add("eac", this.k.ToString());

            string ans = "";

            ans += "过渡矩阵为:\r\n";
            ans += keys["aaa"] + " " + keys["aab"] + " " + keys["aad"] + "\r\n";
            ans += "0" + " " + keys["aac"] + " " + keys["aae"] + "\r\n";
            ans += "0 0 " + keys["aaf"] + "\r\n";
            ans += "p(x)坐标为:(" + keys["eaa"] + "," + keys["eab"] + "," + keys["eac"] + ").\r\n";
            Console.Write(ans);
        }
Beispiel #17
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_4_3_2.xml");
            if (isRegeneration)
            {
                this.a12 = this.numberTools.myRandom(4);
                this.a13 = this.numberTools.myRandom(4);
                this.a14 = this.numberTools.myRandom(4);
                this.a15 = this.numberTools.myRandom(4);
                this.a21 = this.numberTools.myRandom(4);
                this.a23 = this.numberTools.myRandom(4);
                this.a24 = this.numberTools.myRandom(4);
                this.a25 = this.numberTools.myRandom(4);
                this.a31 = this.numberTools.myRandom(4);
                this.a32 = this.numberTools.myRandom(4);
                this.a34 = this.numberTools.myRandom(4);
                this.a35 = this.numberTools.myRandom(4);
                this.m   = this.numberTools.myRandom(3);
                this.n   = this.numberTools.myRandom(3);
                this.a11 = 1;
                this.a22 = (this.a12 * this.a21) + 1;
                this.a33 = ((this.a13 * this.a31) + ((this.a32 - (this.a31 * this.a12)) * (this.a23 - (this.a21 * this.a13)))) + 1;
                this.a41 = (this.a11 * this.m) + (this.a21 * this.n);
                this.a42 = (this.a12 * this.m) + (this.a22 * this.n);
                this.a43 = (this.a13 * this.m) + (this.a23 * this.n);
                this.a44 = (this.a14 * this.m) + (this.a24 * this.n);
                this.a45 = (this.a15 * this.m) + (this.a25 * this.n);
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Params_Cal_4_3_2.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a11")
                        {
                            this.a11 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a12")
                        {
                            this.a12 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a13")
                        {
                            this.a13 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a14")
                        {
                            this.a14 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a15")
                        {
                            this.a15 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a21")
                        {
                            this.a21 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a22")
                        {
                            this.a22 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a23")
                        {
                            this.a23 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a24")
                        {
                            this.a24 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a25")
                        {
                            this.a25 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a31")
                        {
                            this.a31 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a32")
                        {
                            this.a32 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a33")
                        {
                            this.a33 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a34")
                        {
                            this.a34 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a35")
                        {
                            this.a35 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a41")
                        {
                            this.a41 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a42")
                        {
                            this.a42 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a43")
                        {
                            this.a43 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a44")
                        {
                            this.a44 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a45")
                        {
                            this.a45 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "n")
                        {
                            this.m = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "m")
                        {
                            this.n = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }

            int num   = this.a23 - (this.a21 * this.a13);
            int num2  = this.a24 - (this.a21 * this.a14);
            int num3  = this.a25 - (this.a21 * this.a15);
            int num4  = this.a32 - (this.a31 * this.a12);
            int num5  = this.a33 - (this.a31 * this.a13);
            int num6  = this.a34 - (this.a31 * this.a14);
            int num7  = this.a35 - (this.a31 * this.a15);
            int num8  = this.a42 - (this.a41 * this.a12);
            int num9  = this.a43 - (this.a41 * this.a13);
            int num10 = this.a44 - (this.a41 * this.a14);
            int num11 = this.a45 - (this.a41 * this.a15);
            int num12 = this.a13 - (this.a12 * num);
            int num13 = this.a14 - (this.a12 * num2);
            int num14 = this.a15 - (this.a12 * num3);
            int num15 = num6 - (num4 * num2);
            int num16 = num7 - (num4 * num3);
            int num17 = num13 - (num12 * num15);
            int num18 = num14 - (num12 * num16);
            int num19 = num2 - (num * num15);
            int num20 = num3 - (num * num16);

            Console.WriteLine("ξ1: {0} {1} {2} 1 0", -num17, -num19, -num15);
            Console.WriteLine("ξ2: {0} {1} {2} 0 1", -num18, -num20, -num16);
        }
Beispiel #18
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_5_5.xml");
            if (!isRegeneration)
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_5_5.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a")
                        {
                            this.a = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b")
                        {
                            this.b = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c")
                        {
                            this.c = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "k")
                        {
                            this.k = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "m")
                        {
                            this.m = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "n")
                        {
                            this.n = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            while (((((this.a == 0) || (this.b == 0)) || ((this.c == 0) || (this.a == this.b))) || (this.a == this.c)) || (this.b == this.c))
            {
                this.a = this.random.Next(-9, 10);
                this.b = this.random.Next(-9, 10);
                this.c = this.random.Next(-9, 10);
                if (((((this.a != 0) && (this.b != 0)) && ((this.c != 0) && (this.a != this.b))) && (this.a != this.c)) && (this.b != this.c))
                {
                    break;
                }
            }
            this.Ma  = -this.a;
            this.Mb  = -this.b;
            this.Mc  = -this.c;
            this.A   = 5 - this.k;
            this.B   = 5 - this.m;
            this.C   = 5 - this.n;
            this.Mfa = -this.a;
            this.Mfb = -this.b;
            this.Mfc = -this.c;

            string ans = "";
            int    cnt = 0;

            for (int i = 0; i < A; ++i)
            {
                ++cnt;
                ans += "λ" + cnt.ToString() + "=" + a.ToString();
                if (cnt == 5)
                {
                    ans += ".\r\n";
                }
                else
                {
                    ans += ",";
                }
            }
            for (int i = 0; i < B; ++i)
            {
                ++cnt;
                ans += "λ" + cnt.ToString() + "=" + b.ToString();
                if (cnt == 5)
                {
                    ans += ".\r\n";
                }
                else
                {
                    ans += ",";
                }
            }
            for (int i = 0; i < C; ++i)
            {
                ++cnt;
                ans += "λ" + cnt.ToString() + "=" + c.ToString();
                if (cnt == 5)
                {
                    ans += ".\r\n";
                }
                else
                {
                    ans += ",";
                }
            }

            Console.Write(ans);
        }
Beispiel #19
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_7_7.xml");
            if (isRegeneration)
            {
                this.a12 = this.numberTools.myRandom(6);
                this.a13 = this.numberTools.myRandom(6);
                this.a14 = this.numberTools.myRandom(6);
                this.a21 = this.numberTools.myRandom(6);
                this.a23 = this.numberTools.myRandom(6);
                this.a24 = this.numberTools.myRandom(6);
                this.m   = this.numberTools.myRandom(3);
                this.n   = this.numberTools.myRandom(3);
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_7_7.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a11")
                        {
                            this.a11 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a12")
                        {
                            this.a12 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a13")
                        {
                            this.a13 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a14")
                        {
                            this.a14 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a21")
                        {
                            this.a21 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a23")
                        {
                            this.a23 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a24")
                        {
                            this.a24 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "m")
                        {
                            this.m = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "n")
                        {
                            this.n = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            this.a22 = (this.a21 * this.a12) + 1;
            this.a31 = (this.m * this.a11) + (this.n * this.a21);
            this.a32 = (this.m * this.a12) + (this.n * this.a22);
            this.a33 = (this.m * this.a13) + (this.n * this.a23);
            this.a34 = (this.m * this.a14) + (this.n * this.a24);
            this.keys.Add("aaa", this.a11.ToString());
            this.keys.Add("aab", this.intTostring(this.a12));
            this.keys.Add("aac", this.intTostring(this.a13));
            this.keys.Add("aad", this.intTostring(this.a14));
            this.keys.Add("aba", this.a21.ToString());
            this.keys.Add("abb", this.intTostring(this.a22));
            this.keys.Add("abc", this.intTostring(this.a23));
            this.keys.Add("abd", this.intTostring(this.a24));
            this.keys.Add("aca", this.a31.ToString());
            this.keys.Add("acb", this.intTostring(this.a32));
            this.keys.Add("acc", this.intTostring(this.a33));
            this.keys.Add("acd", this.intTostring(this.a34));
            this.keys.Add("bba", ((this.a12 * (this.a23 - (this.a21 * this.a13))) - this.a13).ToString());
            this.keys.Add("bbb", ((this.a21 * this.a13) - this.a23).ToString());
            this.keys.Add("bbc", (((((this.a12 * (this.a23 - (this.a21 * this.a13))) - this.a13) * ((this.a12 * (this.a23 - (this.a21 * this.a13))) - this.a13)) + (((this.a21 * this.a13) - this.a23) * ((this.a21 * this.a13) - this.a23))) + 1).ToString());
            this.keys.Add("bbd", ((this.a12 * (this.a23 - (this.a21 * this.a13))) - this.a13).ToString());
            this.keys.Add("bbe", ((this.a21 * this.a13) - this.a23).ToString());

            string ans = "";

            ans += "E=(1/" + "sqrt(" + keys["bbc"] + "))*(" + keys["bbd"] + "," + keys["bbe"] + ",1,0)T.\r\n";
            Console.Write(ans);
        }
Beispiel #20
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_4_5_2.xml");
            if (isRegeneration)
            {
                this.a12 = this.numberTools.myRandom(3);
                this.a13 = this.numberTools.myRandom(3);
                this.a14 = this.numberTools.myRandom(3);
                this.a21 = this.numberTools.myRandom(3);
                this.a24 = this.numberTools.myRandom(3);
                this.a31 = this.numberTools.myRandom(3);
                this.a34 = this.numberTools.myRandom(3);
                this.b1  = this.numberTools.myRandom(2);
                this.b2  = this.numberTools.myRandom(2);
                this.b3  = this.numberTools.myRandom(2);
                this.c1  = this.numberTools.myRandom(2);
                this.c2  = this.numberTools.myRandom(2);
                this.c3  = this.numberTools.myRandom(2);
                this.a22 = (this.a12 * this.a21) + 1;
                this.a32 = (this.a31 * this.a12) + this.c1;
                this.a23 = (this.a21 * this.a13) + this.c2;
                this.a33 = ((this.a31 * this.a13) + (this.c1 * this.c2)) + 1;
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Params_Cal_4_5_2.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a12")
                        {
                            this.a12 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a13")
                        {
                            this.a13 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a14")
                        {
                            this.a14 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a21")
                        {
                            this.a21 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a22")
                        {
                            this.a22 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a23")
                        {
                            this.a23 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a24")
                        {
                            this.a24 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a31")
                        {
                            this.a31 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a32")
                        {
                            this.a32 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a33")
                        {
                            this.a33 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a34")
                        {
                            this.a34 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b1")
                        {
                            this.b1 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b2")
                        {
                            this.b2 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b3")
                        {
                            this.b3 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c1")
                        {
                            this.c1 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c2")
                        {
                            this.c2 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c3")
                        {
                            this.c3 = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }

            int num  = (this.a34 - (this.c1 * this.a24)) + (((this.c1 * this.a21) - this.a31) * this.a14);
            int num2 = (this.b3 - (this.c1 * this.b2)) + (((this.c1 * this.a21) - this.a31) * this.b1);
            int num3 = (this.a24 - (this.a21 * this.a14)) - (this.c2 * num);
            int num4 = (this.b2 - (this.a21 * this.b1)) - (this.c2 * num2);

            Console.WriteLine("η=(" + ((this.b1 - (this.a13 * num2)) - (this.a12 * num4)).ToString() + "," + num4.ToString() + "," + num2.ToString() + "," + "0" + ")T");
            Console.WriteLine("ξ1=(" + ((this.a14 - (this.a13 * num)) - (this.a12 * num3)).ToString() + "," + num3.ToString() + "," + num.ToString() + "," + "-1" + ")T");
        }
Beispiel #21
0
    /// <summary>
    /// 增加卡片
    /// </summary>
    /// <param name="isMain">是否为主卡组</param>
    /// <param name="id">卡片id</param>
    public void AddCardToDeck(string id)
    {
        Card card   = LoadXml.GetCard(id);
        bool isMain = !ComVal.isInExtra(card.cardType);

        int cardNum = 0;

        if (isMain)
        {
            foreach (var item in curDeck.mainDeck.cardList)
            {
                if (item.cardID == card.cardID)
                {
                    cardNum++;
                }
            }
        }
        else
        {
            foreach (var item in curDeck.extraDeck.cardList)
            {
                if (item.cardID == card.cardID)
                {
                    cardNum++;
                }
            }
        }
        if (cardNum >= 3)
        {
            return;
        }
        if (isMain)
        {
            if (curCard != null)
            {
                int val = GetObjVal(curCard.gameObject, isMain);
                AddToDeckFromPool(card, mainDeckGroup.transform, true);
                curDeck.mainDeck.InsertCard(card, val);
                for (int i = val; i < curDeck.mainDeck.GroupNum; i++)
                {
                    mainDeckList[i].GetComponent <Card_Edit>().SetTexture(curDeck.mainDeck.GetCard(i).cardID, true);
                }
                UpdateText();
                return;
            }
            if (mainDeckList.Count > curDeck.mainDeck.cardList.Count)
            {
                Card_Edit theCard_edit = mainDeckList[curDeck.mainDeck.cardList.Count].GetComponent <Card_Edit>();
                theCard_edit.SetTexture(card.cardID, true);
                theCard_edit.SetActive(true);
            }
            else if (mainDeckList.Count == curDeck.mainDeck.cardList.Count)
            {
                AddToDeckFromPool(card, mainDeckGroup.transform, true);
            }
            else
            {
                Debug.Log("error");
            }

            curDeck.mainDeck.AddCard(card);
        }
        else
        {
            if (curCard != null)
            {
                int val = GetObjVal(curCard.gameObject, isMain);
                AddToDeckFromPool(card, extraDeckGroup.transform, false);
                curDeck.extraDeck.InsertCard(card, val);
                for (int i = val; i < curDeck.extraDeck.GroupNum; i++)
                {
                    extraDeckList[i].GetComponent <Card_Edit>().SetTexture(curDeck.extraDeck.GetCard(i).cardID, true);
                }
                UpdateText();
                return;
            }
            if (extraDeckList.Count > curDeck.extraDeck.cardList.Count)
            {
                Card_Edit theCard_edit = extraDeckList[curDeck.extraDeck.cardList.Count].GetComponent <Card_Edit>();
                theCard_edit.SetTexture(card.cardID, true);
                theCard_edit.SetActive(true);
            }
            else if (extraDeckList.Count == curDeck.extraDeck.cardList.Count)
            {
                AddToDeckFromPool(card, extraDeckGroup.transform, false);
            }
            else
            {
                Debug.Log("error");
            }
            curDeck.extraDeck.AddCard(card);
        }
        UpdateText();
    }
Beispiel #22
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_4_4.xml");
            if (isRegeneration)
            {
                this.a12 = this.numberTools.myRandom(5);
                this.a13 = this.numberTools.myRandom(5);
                this.a21 = this.numberTools.myRandom(5);
                this.a31 = this.numberTools.myRandom(5);
                this.b   = this.numberTools.myRandom(5);
                this.c   = this.numberTools.myRandom(5);
                this.a22 = (this.a21 * this.a12) + 1;
                this.a32 = (this.a31 * this.a12) + this.b;
                this.a23 = (this.a21 * this.a13) + this.c;
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Params_Cal_4_4.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a12")
                        {
                            this.a12 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a13")
                        {
                            this.a13 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a21")
                        {
                            this.a21 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a22")
                        {
                            this.a22 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a23")
                        {
                            this.a23 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a31")
                        {
                            this.a31 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a32")
                        {
                            this.a32 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b")
                        {
                            this.b = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c")
                        {
                            this.c = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }

            Console.WriteLine(((this.a31 * this.a13) + (this.b * this.c)).ToString());
        }
Beispiel #23
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_6_5.xml");
            if (isRegeneration)
            {
                this.a1 = this.random.Next(1, 5);
                this.a2 = this.random.Next(1, 5);
                for (int i = 0; i < 4; i++)
                {
                    this.b.Add(this.numberTools.myRandom(6));
                }
                this.b1  = this.b[0];
                this.b2  = this.b[1];
                this.b3  = this.b[2];
                this.a11 = this.a1;
                this.a12 = (2 * this.a1) * this.b1;
                this.a13 = (2 * this.a1) * this.b2;
                this.a22 = ((this.a1 * this.b1) * this.b1) + this.a2;
                this.a23 = 2 * (((this.a1 * this.b1) * this.b2) + (this.a2 * this.b3));
                this.aa  = this.a11;
                this.Mbb = this.a22;
                this.Mab = this.a12;
                this.Mac = this.a13;
                this.Mbc = this.a23;
                this.C   = ((this.a1 * this.b2) * this.b2) + ((this.a2 * this.b3) * this.b3);
                this.bb  = this.a22;
                this.cc  = this.a33;
                this.Aab = this.a12 / 2;
                this.Aac = this.a13 / 2;
                this.Abc = this.a23 / 2;
                this.X   = this.a1;
                this.XY  = this.a1 * this.a2;
                this.BfC = -this.C;
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_6_5.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a1")
                        {
                            this.a1 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a2")
                        {
                            this.a2 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b1")
                        {
                            this.b1 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b2")
                        {
                            this.b2 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b3")
                        {
                            this.b3 = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            this.a11 = this.a1;
            this.a12 = (2 * this.a1) * this.b1;
            this.a13 = (2 * this.a1) * this.b2;
            this.a22 = ((this.a1 * this.b1) * this.b1) + this.a2;
            this.a23 = 2 * (((this.a1 * this.b1) * this.b2) + (this.a2 * this.b3));
            this.aa  = this.a11;
            this.Mbb = this.a22;
            this.Mab = this.a12;
            this.Mac = this.a13;
            this.Mbc = this.a23;
            this.C   = ((this.a1 * this.b2) * this.b2) + ((this.a2 * this.b3) * this.b3);
            this.bb  = this.a22;
            this.cc  = this.a33;
            this.Aab = this.a12 / 2;
            this.Aac = this.a13 / 2;
            this.Abc = this.a23 / 2;
            this.X   = this.a1;
            this.XY  = this.a1 * this.a2;
            this.BfC = -this.C;
            this.keys.Add("a1", this.a1.ToString());
            this.keys.Add("a2", this.a2.ToString());
            this.keys.Add("b1", this.b1.ToString());
            this.keys.Add("b2", this.b2.ToString());
            this.keys.Add("b3", this.b3.ToString());
            this.a11 = this.a1;
            this.a12 = (2 * this.a1) * this.b1;
            this.a13 = (2 * this.a1) * this.b2;
            this.a22 = ((this.a1 * this.b1) * this.b1) + this.a2;
            this.a23 = 2 * (((this.a1 * this.b1) * this.b2) + (this.a2 * this.b3));
            this.aa  = this.a11;
            this.Mbb = this.a22;
            this.Mab = this.a12;
            this.Mac = this.a13;
            this.Mbc = this.a23;
            this.C   = ((this.a1 * this.b2) * this.b2) + ((this.a2 * this.b3) * this.b3);
            this.bb  = this.a22;
            this.cc  = this.a33;
            this.Aab = this.a12 / 2;
            this.Aac = this.a13 / 2;
            this.Abc = this.a23 / 2;
            this.X   = this.a1;
            this.XY  = this.a1 * this.a2;
            this.BfC = -this.C;
            this.keys.Add("aa", this.aa.ToString());
            this.keys.Add("Mab", this.MintTostring(this.Mab).ToString());
            this.keys.Add("Mac", this.MintTostring(this.Mac).ToString());
            this.keys.Add("Mbc", this.MintTostring(this.Mbc).ToString());
            this.keys.Add("C", this.C.ToString());
            this.keys.Add("bb", this.bb.ToString());
            this.keys.Add("cc", this.cc.ToString());
            this.keys.Add("Aab", this.Aab.ToString());
            this.keys.Add("Aac", this.Aac.ToString());
            this.keys.Add("Abc", this.Abc.ToString());
            this.keys.Add("X", this.X.ToString());
            this.keys.Add("XY", this.XY.ToString());
            this.keys.Add("BfC", this.BfC.ToString());

            string ans = "";

            ans += "t>" + keys["C"] + "\r\n";
            Console.Write(ans);
        }
Beispiel #24
0
        public void Generate_T(string number, bool isRegeneration)
        {
            int num;
            int num2;

            this.xmldocument.Load("XML/Cal_5_2.xml");
            if (isRegeneration)
            {
                this.a11 = this.myRandom(5);
                this.a12 = this.myRandom(5);
                this.a13 = this.myRandom(5);
                this.a21 = this.myRandom(5);
                this.a31 = this.myRandom(5);
                this.a33 = this.myRandom(5);
                if (((this.a12 == -this.a21) || (this.a12 == (this.a33 - this.a11))) || (this.a21 == (this.a11 - this.a33)))
                {
                    this.a12 = 2;
                    this.a21 = 2;
                    this.a33 = 3;
                    this.a11 = 4;
                }
                this.a22     = (this.a11 + this.a12) - this.a21;
                this.a23     = this.a13;
                this.a32     = -this.a31;
                num          = ((this.a11 - this.a21) > (this.a11 + this.a12)) ? (this.a11 + this.a12) : (this.a11 - this.a21);
                this.anwser1 = (num > this.a33) ? this.a33 : num;
                num2         = ((this.a11 - this.a21) > (this.a11 + this.a12)) ? (this.a11 - this.a21) : (this.a11 + this.a12);
                this.anwser3 = (num2 > this.a33) ? num2 : this.a33;
                this.anwser2 = (((this.a11 + this.a22) + this.a33) - this.anwser1) - this.anwser3;
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_5_2.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a11")
                        {
                            this.a11 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a12")
                        {
                            this.a12 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a13")
                        {
                            this.a13 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a21")
                        {
                            this.a21 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a31")
                        {
                            this.a31 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a33")
                        {
                            this.a33 = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
                this.a22     = (this.a11 + this.a12) - this.a21;
                this.a23     = this.a13;
                this.a32     = -this.a31;
                num          = ((this.a11 - this.a21) > (this.a11 + this.a12)) ? (this.a11 + this.a12) : (this.a11 - this.a21);
                this.anwser1 = (num > this.a33) ? this.a33 : num;
                num2         = ((this.a11 - this.a21) > (this.a11 + this.a12)) ? (this.a11 - this.a21) : (this.a11 + this.a12);
                this.anwser3 = (num2 > this.a33) ? num2 : this.a33;
                this.anwser2 = (((this.a11 + this.a22) + this.a33) - this.anwser1) - this.anwser3;
                int num3 = ((this.a13 * this.a31) * this.a21) - ((this.a12 * this.a21) * ((this.a11 - this.a21) - this.a33));
                int num4 = (this.a21 * this.a31) * (this.a21 + this.a12);
                int num5 = (this.a21 * ((this.a11 - this.a21) - this.a33)) + (this.a13 * this.a31);
                int num6 = this.a31 * (this.a21 + this.a12);
                int num7 = ((this.a12 * this.a21) * ((this.a11 - this.a21) - this.a33)) - ((this.a13 * this.a31) * this.a21);
                int num8 = this.a21 * ((this.a21 * (this.a33 - (this.a11 - this.a21))) - (this.a13 * this.a31));
                int num9 = (this.a21 * this.a31) * (this.a21 + this.a12);

                string ans = "";
                ans += "λ1=" + anwser1.ToString() + ",λ2=" + anwser2.ToString() + ",λ3=" + anwser3.ToString() + ";\r\n";
                ans += "属于λ=" + (this.a11 - this.a21).ToString() + "的一个特征向量为(" + num7.ToString() + "," + num8.ToString() + "," + num9.ToString() + ")T;\r\n";
                ans += "属于λ=" + (this.a21 + this.a22).ToString() + "的一个特征向量为(1,1,0)T;\r\n";
                ans += "属于λ=" + this.a33.ToString() + "的一个特征向量为(" + a13.ToString() + "," + a13.ToString() + "," + ((a33 - a22) - a21).ToString() + ")T.\r\n";
                Console.Write(ans);
            }
        }
Beispiel #25
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_4_3_3.xml");
            if (isRegeneration)
            {
                this.a12 = this.numberTools.myRandom(3);
                this.a13 = this.numberTools.myRandom(3);
                this.a14 = this.numberTools.myRandom(3);
                this.a21 = this.numberTools.myRandom(3);
                this.a31 = this.numberTools.myRandom(3);
                this.a41 = this.numberTools.myRandom(3);
                this.b3  = this.numberTools.myRandom(2);
                this.b4  = this.numberTools.myRandom(2);
                this.a15 = this.numberTools.myRandom(5);
                this.a25 = this.numberTools.myRandom(5);
                this.a35 = this.numberTools.myRandom(5);
                this.a45 = this.numberTools.myRandom(5);
                this.a11 = 1;
                this.a22 = (this.a21 * this.a12) + 1;
                this.a32 = (this.a31 * this.a12) + 1;
                this.a42 = (this.a41 * this.a12) + 1;
                this.a23 = (this.a21 * this.a13) + this.b3;
                this.a24 = (this.a21 * this.a14) + this.b4;
                this.a33 = ((this.a31 * this.a13) + this.b3) + 1;
                this.a43 = ((this.a41 * this.a13) + this.b3) + 1;
                this.a34 = ((this.a31 * this.a14) + this.b4) + 1;
                this.a44 = ((this.a41 * this.a14) + this.b4) + 2;
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Params_Cal_4_3_3.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a11")
                        {
                            this.a11 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a12")
                        {
                            this.a12 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a13")
                        {
                            this.a13 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a14")
                        {
                            this.a14 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a15")
                        {
                            this.a15 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a21")
                        {
                            this.a21 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a22")
                        {
                            this.a22 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a23")
                        {
                            this.a23 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a24")
                        {
                            this.a24 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a25")
                        {
                            this.a25 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a31")
                        {
                            this.a31 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a32")
                        {
                            this.a32 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a33")
                        {
                            this.a33 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a34")
                        {
                            this.a34 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a35")
                        {
                            this.a35 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a41")
                        {
                            this.a41 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a42")
                        {
                            this.a42 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a43")
                        {
                            this.a43 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a44")
                        {
                            this.a44 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a45")
                        {
                            this.a45 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b3")
                        {
                            this.b3 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b4")
                        {
                            this.b4 = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            int num  = (this.a45 - this.a35) + ((this.a31 - this.a41) * this.a15);
            int num2 = ((this.a35 - this.a25) + ((this.a21 - this.a31) * this.a15)) - num;
            int num3 = (this.a25 - (this.a21 * this.a15)) - (this.b4 * num);
            int num4 = this.a15 - (this.a14 * num);

            Console.WriteLine("ξ1: {0} {1} {2} {3} -1"
                              , (num4 - (this.a12 * num3)) + (((this.a12 * this.b3) - this.a13) * num2)
                              , num3 - (this.b3 * num2)
                              , num2
                              , num);
        }
Beispiel #26
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_7_5_2.xml");
            if (isRegeneration)
            {
                this.c11 = this.numberTools.myRandom(6);
                this.c22 = this.numberTools.myRandom(6);
                this.c33 = this.numberTools.myRandom(6);
                this.d11 = this.numberTools.myRandom(6);
                this.d22 = this.numberTools.myRandom(6);
                this.d33 = this.numberTools.myRandom(6);
                this.a14 = this.numberTools.myRandom(6);
                this.a24 = this.numberTools.myRandom(6);
                this.a34 = this.numberTools.myRandom(6);
                this.c21 = this.numberTools.myRandom(5);
                this.c31 = this.numberTools.myRandom(5);
                this.c32 = this.numberTools.myRandom(5);
                this.d12 = this.numberTools.myRandom(5);
                this.d13 = this.numberTools.myRandom(5);
                this.d23 = this.numberTools.myRandom(5);
                this.a11 = this.c11 * this.d11;
                this.a12 = this.c11 * this.d12;
                this.a13 = this.c11 * this.d13;
                this.a21 = this.c21 * this.d11;
                this.a31 = this.c31 * this.d11;
                this.a22 = (this.c21 * this.d12) + (this.c22 * this.d22);
                this.a23 = (this.c21 * this.d13) + (this.c22 * this.d23);
                this.a32 = (this.a31 * this.d12) + (this.c32 * this.d22);
                this.a33 = ((this.c31 * this.d13) + (this.c32 * this.d23)) + (this.c33 * this.d33);
                while (this.m == this.n)
                {
                    this.m = this.numberTools.myRandom(4);
                    this.n = this.numberTools.myRandom(4);
                }
                this.a41  = (this.m * this.a11) + (this.n * this.a21);
                this.a42  = (this.m * this.a12) + (this.n * this.a22);
                this.a43  = (this.m * this.a13) + (this.n * this.a23);
                this.a44  = (this.m * this.a14) + (this.n * this.a24);
                this.ddda = (((this.a33 * this.a11) - (this.a31 * this.a13)) * ((this.a22 * this.a11) - (this.a21 * this.a12))) - (((this.a32 * this.a11) - (this.a31 * this.a12)) * ((this.a23 * this.a11) - (this.a21 * this.a13)));
                this.dddb = ((this.a22 * this.a11) - (this.a21 * this.a12)) * this.a11;
                this.dddc = (((this.a43 * this.a11) - (this.a41 * this.a13)) * ((this.a22 * this.a11) - (this.a21 * this.a12))) - (((this.a42 * this.a11) - (this.a41 * this.a12)) * ((this.a23 * this.a11) - (this.a21 * this.a13)));
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_7_5_2.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "c11")
                        {
                            this.c11 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c22")
                        {
                            this.c22 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c33")
                        {
                            this.c33 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "d11")
                        {
                            this.d11 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "d22")
                        {
                            this.d22 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "d33")
                        {
                            this.d33 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a14")
                        {
                            this.a14 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a24")
                        {
                            this.a24 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a34")
                        {
                            this.a34 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c21")
                        {
                            this.c21 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c31")
                        {
                            this.c31 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c32")
                        {
                            this.c32 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "d12")
                        {
                            this.d12 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "d13")
                        {
                            this.d13 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "d23")
                        {
                            this.d23 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "m")
                        {
                            this.m = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "n")
                        {
                            this.n = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            this.a11  = this.c11 * this.d11;
            this.a12  = this.c11 * this.d12;
            this.a13  = this.c11 * this.d13;
            this.a21  = this.c21 * this.d11;
            this.a31  = this.c31 * this.d11;
            this.a22  = (this.c21 * this.d12) + (this.c22 * this.d22);
            this.a23  = (this.c21 * this.d13) + (this.c22 * this.d23);
            this.a32  = (this.a31 * this.d12) + (this.c32 * this.d22);
            this.a33  = ((this.c31 * this.d13) + (this.c32 * this.d23)) + (this.c33 * this.d33);
            this.a41  = (this.m * this.a11) + (this.n * this.a21);
            this.a42  = (this.m * this.a12) + (this.n * this.a22);
            this.a43  = (this.m * this.a13) + (this.n * this.a23);
            this.a44  = (this.m * this.a14) + (this.n * this.a24);
            this.ddda = (((this.a33 * this.a11) - (this.a31 * this.a13)) * ((this.a22 * this.a11) - (this.a21 * this.a12))) - (((this.a32 * this.a11) - (this.a31 * this.a12)) * ((this.a23 * this.a11) - (this.a21 * this.a13)));
            this.dddb = ((this.a22 * this.a11) - (this.a21 * this.a12)) * this.a11;
            this.dddc = (((this.a43 * this.a11) - (this.a41 * this.a13)) * ((this.a22 * this.a11) - (this.a21 * this.a12))) - (((this.a42 * this.a11) - (this.a41 * this.a12)) * ((this.a23 * this.a11) - (this.a21 * this.a13)));
            this.keys.Add("aaa", this.a11.ToString());
            this.keys.Add("aab", this.a12.ToString());
            this.keys.Add("aac", this.a13.ToString());
            this.keys.Add("aad", this.a14.ToString());
            this.keys.Add("aba", this.a21.ToString());
            this.keys.Add("abb", this.a22.ToString());
            this.keys.Add("abc", this.a23.ToString());
            this.keys.Add("abd", this.a24.ToString());
            this.keys.Add("aca", this.a31.ToString());
            this.keys.Add("acb", this.a32.ToString());
            this.keys.Add("acc", this.a33.ToString());
            this.keys.Add("acd", this.a34.ToString());
            this.keys.Add("ada", this.a41.ToString());
            this.keys.Add("adb", this.a42.ToString());
            this.keys.Add("adc", this.a43.ToString());
            this.keys.Add("add", this.a44.ToString());
            this.keys.Add("bbbs", ((this.a22 * this.a11) - (this.a21 * this.a12)).ToString());
            this.keys.Add("bbbt", this.a11.ToString());
            this.keys.Add("bbcs", ((this.a23 * this.a11) - (this.a21 * this.a13)).ToString());
            this.keys.Add("bbds", ((this.a24 * this.a11) - (this.a21 * this.a14)).ToString());
            this.keys.Add("bcbs", ((this.a32 * this.a11) - (this.a31 * this.a12)).ToString());
            this.keys.Add("bccs", ((this.a33 * this.a11) - (this.a31 * this.a13)).ToString());
            this.keys.Add("bcds", ((this.a34 * this.a11) - (this.a31 * this.a14)).ToString());
            this.keys.Add("bdbs", ((this.a42 * this.a11) - (this.a41 * this.a12)).ToString());
            this.keys.Add("bdcs", ((this.a43 * this.a11) - (this.a41 * this.a13)).ToString());
            this.keys.Add("bdds", ((this.a44 * this.a11) - (this.a41 * this.a14)).ToString());
            this.keys.Add("ccca", this.ddda.ToString());
            this.keys.Add("cccb", this.dddb.ToString());
            this.keys.Add("cdca", this.dddc.ToString());
            this.keys.Add("cdcb", this.dddb.ToString());

            string ans = "";

            ans += "维数是:3;一组基是:α1,α2,α3.\r\n";
            Console.Write(ans);
        }
Beispiel #27
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_6_3.xml");
            if (isRegeneration)
            {
                this.A.Add(this.numberTools.myRandom(4));
                this.B.Add(this.numberTools.myRandom(4));
                this.C.Add(this.numberTools.myRandom(4));
                this.a    = this.A[0];
                this.b    = this.B[0];
                this.c    = this.C[0];
                this.a11  = this.a;
                this.a22  = (this.a + (this.b * this.b)) - 1;
                this.a33  = (this.a + (this.c * this.c)) - 1;
                this.a12  = 2 * this.b;
                this.a13  = 2 * this.c;
                this.a23  = (2 * this.b) * this.c;
                this.Mbb  = this.a22;
                this.Mab  = this.a12;
                this.Mac  = this.a13;
                this.Mbc  = this.a23;
                this.Mcc  = this.a33;
                this.D    = this.a - 1;
                this.MD   = this.a - 1;
                this.F    = (this.a + (this.b * this.b)) + (this.c * this.c);
                this.MF   = (this.a + (this.b * this.b)) + (this.c * this.c);
                this.TD   = this.D;
                this.TF   = this.F;
                this.Mb   = this.b;
                this.Mc   = this.c;
                this.mn   = this.b * this.c;
                this.aa   = this.a11;
                this.Aab  = this.a12 / 2;
                this.Aac  = this.a13 / 2;
                this.bb   = this.a22;
                this.Abc  = this.a23 / 2;
                this.cc   = this.a33;
                this.Bfaa = -this.a11;
                this.fAab = -this.a12 / 2;
                this.fAac = -this.a13 / 2;
                this.Bfbb = -this.a22;
                this.fAbc = -this.a23 / 2;
                this.Bfcc = -this.a33;
                this.Bfk  = -this.a;
                this.fm   = -this.b;
                this.fn   = -this.c;
                this.Tm   = this.b;
                this.Tn   = this.c;
                this.BfD  = -this.D;
                this.BfF  = -this.F;
                this.m    = this.b;
                this.n    = this.c;
                this.I    = 1 + (this.b * this.b);
                this.fI   = -this.I;
                this.K    = (1 + (this.b * this.b)) + (this.c * this.c);
                this.J    = this.I * this.K;
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_6_3.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a")
                        {
                            this.a = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b")
                        {
                            this.b = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c")
                        {
                            this.c = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            this.a11  = this.a;
            this.a22  = (this.a + (this.b * this.b)) - 1;
            this.a33  = (this.a + (this.c * this.c)) - 1;
            this.a12  = 2 * this.b;
            this.a13  = 2 * this.c;
            this.a23  = (2 * this.b) * this.c;
            this.Mbb  = this.a22;
            this.Mab  = this.a12;
            this.Mac  = this.a13;
            this.Mbc  = this.a23;
            this.Mcc  = this.a33;
            this.D    = this.a - 1;
            this.MD   = this.a - 1;
            this.F    = (this.a + (this.b * this.b)) + (this.c * this.c);
            this.MF   = (this.a + (this.b * this.b)) + (this.c * this.c);
            this.TD   = this.D;
            this.TF   = this.F;
            this.Mb   = this.b;
            this.Mc   = this.c;
            this.mn   = this.b * this.c;
            this.aa   = this.a11;
            this.Aab  = this.a12 / 2;
            this.Aac  = this.a13 / 2;
            this.bb   = this.a22;
            this.Abc  = this.a23 / 2;
            this.cc   = this.a33;
            this.Bfaa = -this.a11;
            this.fAab = -this.a12 / 2;
            this.fAac = -this.a13 / 2;
            this.Bfbb = -this.a22;
            this.fAbc = -this.a23 / 2;
            this.Bfcc = -this.a33;
            this.Bfk  = -this.a;
            this.fm   = -this.b;
            this.fn   = -this.c;
            this.Tm   = this.b;
            this.Tn   = this.c;
            this.BfD  = -this.D;
            this.BfF  = -this.F;
            this.m    = this.b;
            this.n    = this.c;
            this.I    = 1 + (this.b * this.b);
            this.fI   = -this.I;
            this.K    = (1 + (this.b * this.b)) + (this.c * this.c);
            this.J    = this.I * this.K;
            this.a11  = this.a;
            this.a22  = (this.a + (this.b * this.b)) - 1;
            this.a33  = (this.a + (this.c * this.c)) - 1;
            this.a12  = 2 * this.b;
            this.a13  = 2 * this.c;
            this.a23  = (2 * this.b) * this.c;
            this.Mbb  = this.a22;
            this.Mab  = this.a12;
            this.Mac  = this.a13;
            this.Mbc  = this.a23;
            this.Mcc  = this.a33;
            this.D    = this.a - 1;
            this.MD   = this.a - 1;
            this.F    = (this.a + (this.b * this.b)) + (this.c * this.c);
            this.MF   = (this.a + (this.b * this.b)) + (this.c * this.c);
            this.TD   = this.D;
            this.TF   = this.F;
            this.Mb   = this.b;
            this.Mc   = this.c;
            this.mn   = this.b * this.c;
            this.aa   = this.a11;
            this.Aab  = this.a12 / 2;
            this.Aac  = this.a13 / 2;
            this.bb   = this.a22;
            this.Abc  = this.a23 / 2;
            this.cc   = this.a33;
            this.Bfaa = -this.a11;
            this.fAab = -this.a12 / 2;
            this.fAac = -this.a13 / 2;
            this.Bfbb = -this.a22;
            this.fAbc = -this.a23 / 2;
            this.Bfcc = -this.a33;
            this.Bfk  = -this.a;
            this.fm   = -this.b;
            this.fn   = -this.c;
            this.Tm   = this.b;
            this.Tn   = this.c;
            this.BfD  = -this.D;
            this.BfF  = -this.F;
            this.m    = this.b;
            this.n    = this.c;
            this.I    = 1 + (this.b * this.b);
            this.fI   = -this.I;
            this.K    = (1 + (this.b * this.b)) + (this.c * this.c);
            this.J    = this.I * this.K;
            this.keys.Add("a", this.a.ToString());
            this.keys.Add("b", this.b.ToString());
            this.keys.Add("c", this.c.ToString());
            this.keys.Add("Mbb", this.MintTostring(this.Mbb).ToString());
            this.keys.Add("Mab", this.MintTostring(this.Mab).ToString());
            this.keys.Add("Mac", this.MintTostring(this.Mac).ToString());
            this.keys.Add("Mbc", this.MintTostring(this.Mbc).ToString());
            this.keys.Add("Mcc", this.MintTostring(this.Mcc).ToString());
            this.keys.Add("D", this.D.ToString());
            this.keys.Add("MD", this.MintTostring(this.MD).ToString());
            this.keys.Add("F", this.F.ToString());
            this.keys.Add("MF", this.MintTostring(this.MF).ToString());
            this.keys.Add("TD", this.TintTostring(this.TD).ToString());
            this.keys.Add("TF", this.TintTostring(this.TF).ToString());
            this.keys.Add("Mb", this.MintTostring(this.Mb).ToString());
            this.keys.Add("Mc", this.MintTostring(this.Mc).ToString());
            this.keys.Add("mn", this.mn.ToString());
            this.keys.Add("aa", this.aa.ToString());
            this.keys.Add("Aab", this.Aab.ToString());
            this.keys.Add("Aac", this.Aac.ToString());
            this.keys.Add("bb", this.bb.ToString());
            this.keys.Add("Abc", this.Abc.ToString());
            this.keys.Add("cc", this.cc.ToString());
            this.keys.Add("Bfaa", this.BintTostring(this.Bfaa).ToString());
            this.keys.Add("fAab", this.fAab.ToString());
            this.keys.Add("fAac", this.fAac.ToString());
            this.keys.Add("Bfbb", this.BintTostring(this.Bfbb).ToString());
            this.keys.Add("fAbc", this.fAbc.ToString());
            this.keys.Add("Bfcc", this.BintTostring(this.Bfcc).ToString());
            this.keys.Add("Bfk", this.BintTostring(this.Bfk).ToString());
            this.keys.Add("fm", this.fm.ToString());
            this.keys.Add("fn", this.fn.ToString());
            this.keys.Add("Tm", this.TintTostring(this.Tm).ToString());
            this.keys.Add("Tn", this.TintTostring(this.Tn).ToString());
            this.keys.Add("BfD", this.BintTostring(this.BfD).ToString());
            this.keys.Add("BfF", this.BintTostring(this.BfF).ToString());
            this.keys.Add("m", this.m.ToString());
            this.keys.Add("n", this.n.ToString());
            this.keys.Add("I", this.I.ToString());
            this.keys.Add("fI", this.fI.ToString());
            this.keys.Add("K", this.K.ToString());
            this.keys.Add("J", this.J.ToString());

            string ans = "";

            ans += "(1) f(x1,x2,x3)=" + keys["TD"] + "(y1)^2" + keys["MD"] + "(y2)^2" + keys["MF"] + "(y3)^2\r\n";
            ans += "(2) x1=" + "(" + keys["m"] + "/sqrt(" + keys["I"] + "))y1+" + "(" + keys["n"] + "/sqrt(" + keys["J"] + "))y2+" + "(" + "1" + "/sqrt(" + keys["K"] + "))y3\r\n";
            ans += "    x2=" + "(" + "-1" + "/sqrt(" + keys["I"] + "))y1+" + "(" + keys["mn"] + "/sqrt(" + keys["J"] + "))y2+" + "(" + keys["m"] + "/sqrt(" + keys["K"] + "))y3\r\n";
            ans += "    x3=" + "(" + "0" + ")y1+" + "(-" + keys["I"] + "/sqrt(" + keys["J"] + "))y2+" + "(" + keys["n"] + "/sqrt(" + keys["K"] + "))y3\r\n";

            Console.Write(ans);
        }
Beispiel #28
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_5_8.xml");
            if (isRegeneration)
            {
                this.S.Add(this.numberTools.myRandom(6));
                this.O.Add(this.numberTools.myRandom(2));
                this.T.Add(this.numberTools.myRandom(2));
                this.a     = this.S[0];
                this.b     = this.O[0];
                this.c     = this.T[0];
                this.a11   = this.a;
                this.a12   = this.b;
                this.a13   = this.c;
                this.a22   = (this.a + (this.b * this.b)) - 1;
                this.a23   = this.b * this.c;
                this.a33   = (this.a + (this.c * this.c)) - 1;
                this.X     = this.a - 1;
                this.Y     = (this.a + (this.b * this.b)) + (this.c * this.c);
                this.Mb    = this.b;
                this.Mc    = this.c;
                this.Tb    = this.b;
                this.Tc    = this.c;
                this.A     = 1 + (this.b * this.b);
                this.B     = this.A * ((1 + (this.b * this.b)) + (this.c * this.c));
                this.C     = (1 + (this.b * this.b)) + (this.c * this.c);
                this.Bfaa  = -this.a11;
                this.fab   = -this.a12;
                this.fac   = -this.a13;
                this.Bfbb  = -this.a22;
                this.fbc   = -this.a23;
                this.Bfcc  = -this.a33;
                this.Bfa   = -this.a;
                this.fb    = -this.b;
                this.fc    = -this.c;
                this.Taf1  = this.a - 1;
                this.Bfaf1 = -(this.a - 1);
                this.BD    = -((this.a + (this.b * this.b)) + (this.c * this.c));
                this.fD    = this.Y;
                this.TfD   = this.Y;
                this.F     = -(1 + (this.b * this.b));
                this.fba   = this.a;
                this.bc    = this.b * this.c;
                this.Z     = 1 + (this.b * this.b);
                this.af1   = this.a - 1;
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_5_8.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a")
                        {
                            this.a = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "b")
                        {
                            this.b = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "c")
                        {
                            this.c = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            this.a11   = this.a;
            this.a12   = this.b;
            this.a13   = this.c;
            this.a22   = (this.a + (this.b * this.b)) - 1;
            this.a23   = this.b * this.c;
            this.a33   = (this.a + (this.c * this.c)) - 1;
            this.X     = this.a - 1;
            this.Y     = (this.a + (this.b * this.b)) + (this.c * this.c);
            this.Mb    = this.b;
            this.Mc    = this.c;
            this.Tb    = this.b;
            this.Tc    = this.c;
            this.A     = 1 + (this.b * this.b);
            this.B     = this.A * ((1 + (this.b * this.b)) + (this.c * this.c));
            this.C     = (1 + (this.b * this.b)) + (this.c * this.c);
            this.Bfaa  = -this.a11;
            this.fab   = -this.a12;
            this.fac   = -this.a13;
            this.Bfbb  = -this.a22;
            this.fbc   = -this.a23;
            this.Bfcc  = -this.a33;
            this.Bfa   = -this.a;
            this.fb    = -this.b;
            this.fc    = -this.c;
            this.Taf1  = this.a - 1;
            this.Bfaf1 = -(this.a - 1);
            this.BD    = -((this.a + (this.b * this.b)) + (this.c * this.c));
            this.fD    = this.Y;
            this.TfD   = this.Y;
            this.F     = -(1 + (this.b * this.b));
            this.fba   = this.a;
            this.bc    = this.b * this.c;
            this.Z     = 1 + (this.b * this.b);
            this.af1   = this.a - 1;

            string ans = "";

            ans += "(1) λ1=" + X.ToString() + ",λ2=" + X.ToString() + ",λ3=" + Y.ToString() + ";\r\n";

            this.a11   = this.a;
            this.a12   = this.b;
            this.a13   = this.c;
            this.a22   = (this.a + (this.b * this.b)) - 1;
            this.a23   = this.b * this.c;
            this.a33   = (this.a + (this.c * this.c)) - 1;
            this.X     = this.a - 1;
            this.Y     = (this.a + (this.b * this.b)) + (this.c * this.c);
            this.Mb    = this.b;
            this.Mc    = this.c;
            this.Tb    = this.b;
            this.Tc    = this.c;
            this.A     = 1 + (this.b * this.b);
            this.B     = this.A * ((1 + (this.b * this.b)) + (this.c * this.c));
            this.C     = (1 + (this.b * this.b)) + (this.c * this.c);
            this.Bfaa  = -this.a11;
            this.fab   = -this.a12;
            this.fac   = -this.a13;
            this.Bfbb  = -this.a22;
            this.fbc   = -this.a23;
            this.Bfcc  = -this.a33;
            this.Bfa   = -this.a;
            this.fb    = -this.b;
            this.fc    = -this.c;
            this.Taf1  = this.a - 1;
            this.Bfaf1 = -(this.a - 1);
            this.BD    = -((this.a + (this.b * this.b)) + (this.c * this.c));
            this.fD    = this.Y;
            this.TfD   = this.Y;
            this.F     = -(1 + (this.b * this.b));
            this.fba   = this.a;
            this.bc    = this.b * this.c;
            this.Z     = 1 + (this.b * this.b);
            this.af1   = this.a - 1;

            ans += "(2) " + "α1=(" + fb.ToString() + ",1,0)\r\n";
            ans += "α2=(" + fc.ToString() + ",0,1)\r\n";
            ans += "α3=(1," + b.ToString() + "," + c.ToString() + ")\r\n";
            ans += "(3) Q=\r\n";
            ans += b.ToString() + "/sqrt(" + A.ToString() + ") " + c.ToString() + "/sqrt(" + B.ToString() + ") 1/sqrt(" + C.ToString() + ")\r\n";
            ans += "-1" + "/sqrt(" + A.ToString() + ") " + bc.ToString() + "/sqrt(" + B.ToString() + ") " + b.ToString() + "/sqrt(" + C.ToString() + ")\r\n";
            ans += "0 -" + Z.ToString() + "/sqrt(" + B.ToString() + ") " + c.ToString() + "/sqrt(" + C.ToString() + ")\r\n";
            ans += "(4) Q-1AQ=\r\n";
            ans += X.ToString() + " " + "0 0\r\n";
            ans += "0 " + X.ToString() + " 0\r\n";
            ans += "0 0 " + Y.ToString() + "\r\n";

            Console.Write(ans);
        }
Beispiel #29
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_3_4.xml");
            if (isRegeneration)
            {
                this.a13 = this.numberTools.myRandom(5);
                this.a14 = this.numberTools.myRandom(5);
                this.a23 = this.numberTools.myRandom(5);
                this.a24 = this.numberTools.myRandom(5);
                do
                {
                    this.a11 = this.numberTools.myRandom(5);
                    this.a22 = this.numberTools.myRandom(5);
                    this.a12 = this.numberTools.myRandom(5);
                    this.a21 = this.numberTools.myRandom(5);
                }while ((this.a11 * this.a22) == (this.a12 * this.a21));
                this.m   = this.numberTools.myRandom(5);
                this.n   = this.numberTools.myRandom(5);
                this.t   = this.random.Next(0, 2);
                this.a31 = (this.a11 * this.m) + (this.a21 * this.n);
                this.a32 = (this.a12 * this.m) + (this.a22 * this.n);
                this.a33 = ((this.a13 * this.m) + (this.a23 * this.n)) + (this.t * 3);
                this.a34 = ((this.a14 * this.m) + (this.a24 * this.n)) + (this.t * 4);
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Params_Cal_3_4.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a11")
                        {
                            this.a11 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a12")
                        {
                            this.a12 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a13")
                        {
                            this.a13 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a14")
                        {
                            this.a14 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a21")
                        {
                            this.a21 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a22")
                        {
                            this.a22 = int.Parse(node2.InnerText);
                        }
                        if (node2.Name == "a23")
                        {
                            this.a23 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a24")
                        {
                            this.a24 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a31")
                        {
                            this.a31 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a32")
                        {
                            this.a32 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a33")
                        {
                            this.a33 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a34")
                        {
                            this.a34 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "m")
                        {
                            this.m = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "n")
                        {
                            this.n = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "t")
                        {
                            this.t = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }

            if (this.t == 0)
            {
                Console.WriteLine("相");
            }
            else if (this.t == 1)
            {
                Console.WriteLine("无");
            }
        }
Beispiel #30
0
        public void Generate_T(string number, bool isRegeneration)
        {
            this.xmldocument.Load("XML/Cal_5_7.xml");
            if (isRegeneration)
            {
                this.b11.Add(this.numberTools.myRandom(5));
                this.b22.Add(this.numberTools.myRandom(5));
                this.c11.Add(this.numberTools.myRandom(5));
                this.c12.Add(this.numberTools.myRandom(3));
                this.c22.Add(this.numberTools.myRandom(6));
                if (this.b11[0] == this.b22[0])
                {
                    this.b22[0] = -this.b22[0];
                }
                this.λ1     = this.b11[0];
                this.λ2     = this.b22[0];
                this.a11    = this.c11[0];
                this.a12    = this.c12[0];
                this.a22    = this.c22[0];
                this.a13    = 1;
                this.a33    = (((2 * this.λ1) + this.λ2) - this.a11) - this.a22;
                this.a31    = (this.a11 - this.λ1) * (this.a33 - this.λ1);
                this.a32    = this.a12 * (this.a33 - this.λ1);
                this.C      = this.λ1;
                this.D      = this.λ2;
                this.X      = (this.a11 - this.λ1) * (this.a22 - this.λ1);
                this.Y      = this.a22 - this.λ1;
                this.ab     = this.a12;
                this.bbfC   = this.a22 - this.C;
                this.Cfaa   = this.C - this.a11;
                this.fab    = -this.a12;
                this.F      = this.a12 * (this.a33 - this.λ1);
                this.H      = (this.a11 + this.a22) + this.a33;
                this.I      = this.λ1 + this.λ2;
                this.MfC    = -this.C;
                this.aafC   = this.a11 - this.λ1;
                this.ccfC   = this.a33 - this.λ1;
                this.ca     = this.a31;
                this.cb     = this.a32;
                this.TD     = this.λ2;
                this.Taafd1 = this.a11 - this.λ1;
                this.Mab    = this.a12;
                this.Tbbfd1 = this.a22 - this.λ1;
                this.Tccfd1 = this.a33 - this.λ1;
            }
            else
            {
                XmlNode node = LoadXml.LoadShowParameterXml("Parms_Cal_5_7.xml");
                foreach (XmlNode node2 in node.ChildNodes)
                {
                    try
                    {
                        if (node2.Name == "a11")
                        {
                            this.a11 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a12")
                        {
                            this.a12 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "a22")
                        {
                            this.a22 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "λ1")
                        {
                            this.λ1 = int.Parse(node2.InnerText);
                        }
                        else if (node2.Name == "λ2")
                        {
                            this.λ2 = int.Parse(node2.InnerText);
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("参数有问题");
                    }
                }
            }
            this.a13    = 1;
            this.a33    = (((2 * this.λ1) + this.λ2) - this.a11) - this.a22;
            this.a31    = (this.a11 - this.λ1) * (this.a33 - this.λ1);
            this.a32    = this.a12 * (this.a33 - this.λ1);
            this.C      = this.λ1;
            this.D      = this.λ2;
            this.X      = (this.a11 - this.λ1) * (this.a22 - this.λ1);
            this.Y      = this.a22 - this.λ1;
            this.ab     = this.a12;
            this.bbfC   = this.a22 - this.C;
            this.Cfaa   = this.C - this.a11;
            this.fab    = -this.a12;
            this.F      = this.a12 * (this.a33 - this.λ1);
            this.H      = (this.a11 + this.a22) + this.a33;
            this.I      = this.λ1 + this.λ2;
            this.MfC    = -this.C;
            this.aafC   = this.a11 - this.λ1;
            this.ccfC   = this.a33 - this.λ1;
            this.ca     = this.a31;
            this.cb     = this.a32;
            this.TD     = this.λ2;
            this.Taafd1 = this.a11 - this.λ1;
            this.Mab    = this.a12;
            this.Tbbfd1 = this.a22 - this.λ1;
            this.Tccfd1 = this.a33 - this.λ1;
            this.a13    = 1;
            this.a33    = (((2 * this.λ1) + this.λ2) - this.a11) - this.a22;
            this.a31    = (this.a11 - this.λ1) * (this.a33 - this.λ1);
            this.a32    = this.a12 * (this.a33 - this.λ1);
            this.C      = this.λ1;
            this.D      = this.λ2;
            this.X      = (this.a11 - this.λ1) * (this.a22 - this.λ1);
            this.Y      = this.a22 - this.λ1;
            this.ab     = this.a12;
            this.bbfC   = this.a22 - this.C;
            this.Cfaa   = this.C - this.a11;
            this.fab    = -this.a12;
            this.F      = this.a12 * (this.a33 - this.λ1);
            this.H      = (this.a11 + this.a22) + this.a33;
            this.I      = this.λ1 + this.λ2;
            this.MfC    = -this.C;
            this.aafC   = this.a11 - this.λ1;
            this.ccfC   = this.a33 - this.λ1;
            this.ca     = this.a31;
            this.cb     = this.a32;
            this.TD     = this.λ2;
            this.Taafd1 = this.a11 - this.λ1;
            this.Mab    = this.a12;
            this.Tbbfd1 = this.a22 - this.λ1;
            this.Tccfd1 = this.a33 - this.λ1;

            string ans = "";

            ans += "(1) x=";
            ans += X.ToString() + "/" + ab.ToString() + "; ";
            ans += "y=";
            ans += Y.ToString() + "/" + ab.ToString() + "; ";
            ans += "z=";
            ans += λ1.ToString() + ";\r\n";
            ans += "(2) P=\r\n";
            //ans += "p11 p13 p12\r\n";
            //ans += "p21 p23 p22\r\n";
            //ans += "p31 p33 p32\r\n";
            //ans += "只要满足" + this.TintTostring(this.Taafd1).ToString() + "p1i" + this.MintTostring(this.Mab).ToString()
            //    + "p2i+p3i=0(i=1或2) 并且 " + this.TintTostring(this.Tbbfd1).ToString() + "p13"
            //    + this.MintTostring(this.Mab).ToString() + "p23=0," + this.TintTostring(this.Tccfd1).ToString() + "p13=p33.\r\n";
            ans += "1 " + ab.ToString() + " 0\r\n";
            ans += "0 " + bbfC.ToString() + " 1\r\n";
            ans += Cfaa.ToString() + " " + F.ToString() + " " + fab.ToString() + "\r\n";
            Console.Write(ans);
        }