示例#1
0
        private void btnResults_Click(object sender, EventArgs e)
        {
            double[,] startMas = new double[dgvParameters.RowCount, dgvParameters.ColumnCount];
            double[,] resMas1 = new double[dgvParameters.RowCount, dgvParameters.ColumnCount];
            double[,] resMas2 = new double[dgvParameters.RowCount, dgvParameters.ColumnCount];

            int k = 0;
            for (int i = 0; i < dgvParameters.RowCount; i++)
            {
                for (int j = 0; j < dgvParameters.ColumnCount; j++)
                {
                    startMas[i, j] = Convert.ToDouble(dgvParameters.Rows[i].Cells[j].Value);
                    resMas1[i, j] = ra1 != null ? ra1.x[k] : double.NaN;
                    resMas2[i, j] = ra2 != null ? ra2.x[k] : double.NaN;
                    k++;
                }
            }

            ResultForm rf = new ResultForm(this.curves.ContainsKey(this.curveName) ? this.curves[this.curveName] : null,
                this.curves.ContainsKey(this.curveName1) ? this.curves[this.curveName1] : null,
                this.curves.ContainsKey(this.curveName2) ? this.curves[this.curveName2] : null,
                startMas, resMas1, resMas2, dgvParameters.RowCount, dgvParameters.ColumnCount, this.inf1, this.inf2,
                this.randomStartParameters);
            rf.Show();
        }
示例#2
0
        private void btnResults_Click(object sender, EventArgs e)
        {
            var startMas = new double[dgvParameters.RowCount,dgvParameters.ColumnCount];
            var resMas1 = new double[dgvParameters.RowCount,dgvParameters.ColumnCount];
            var resMas2 = new double[dgvParameters.RowCount,dgvParameters.ColumnCount];

            int k = 0;
            for (int i = 0; i < dgvParameters.RowCount; i++)
            {
                for (int j = 0; j < dgvParameters.ColumnCount; j++)
                {
                    startMas[i, j] = Convert.ToDouble(dgvParameters.Rows[i].Cells[j].Value);
                    resMas1[i, j] = ra1 != null ? ra1.x[k] : double.NaN;
                    resMas2[i, j] = ra2 != null ? ra2.x[k] : double.NaN;
                    k++;
                }
            }

            var rf = new ResultForm(this, startMas, resMas1, resMas2, dgvParameters.RowCount, dgvParameters.ColumnCount,
                                    inf1, inf2, randomStartParameters);
            rf.Show();
        }