コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (Validate())
            {
                try {
                    LinearSystem system = new LinearSystem(MatrixA, VectorB);
                    resultX          = system.XVector;
                    middleComplexity = calculateComplexity(resultX, VectorX);
                    // call DFS to mark the cycles
                    //graph.addEdge(1, 2);
                    //graph.addEdge(2, 3);
                    //graph.addEdge(3, 4);
                    //graph.addEdge(4, 6);
                    //graph.addEdge(4, 7);
                    //graph.addEdge(5, 6);
                    //graph.addEdge(3, 5);
                    //graph.addEdge(7, 8);
                    //graph.addEdge(6, 10);
                    //graph.addEdge(5, 9);
                    //graph.addEdge(10, 11);
                    //graph.addEdge(11, 12);
                    //graph.addEdge(11, 13);
                    //graph.addEdge(12, 13);
                    //graph.dfs_cycle(1, 0);
                    cycles = graph.resultString;
                    ResultForm newForm = new ResultForm(this);

                    newForm.Show();
                    //VectorU = system.UVector;
                } catch (Exception error) {
                    MessageBox.Show(error.Message);
                }
            }
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (Validate())
            {
                try {
                    LinearSystem system = new LinearSystem(MatrixA, VectorB);
                    resultX          = system.XVector;
                    middleComplexity = calculateComplexity(resultX, VectorX);
                    cycles           = graph.detectedCycles;
                    ResultForm newForm = new ResultForm(this);

                    newForm.Show();
                    //VectorU = system.UVector;
                } catch (Exception error) {
                    MessageBox.Show(error.Message);
                }
            }
        }