Пример #1
0
 /// <summary>
 /// Установка заданного размера
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnGenerate_Click(object sender, EventArgs e)
 {
     tbSum.Clear();
     dtStart.ReadOnly = false;
     dtResult.Visible = false;
     if (getNumber())
     {
         MatrMake.instailDataGrid(countCol, countRow, width, dtStart);
     }
     changeVisible(true, true);
 }
Пример #2
0
        /// <summary>
        /// Поиск максимального прямоугольника
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSearch_Click(object sender, EventArgs e)
        {
            dtResult.Visible = true;
            MatrMake matr = new MatrMake(countRow, countCol);

            matr.GridToMatrix(dtStart);
            Search search = new Search(matr.getMatrix());

            search.maxSubMatrix();
            matr.setMatrix(search.getNewMatrix());
            matr.N_col = search.N_col;
            matr.N_str = search.N_str;

            MatrMake.instailDataGrid(matr.N_col, matr.N_str, width, dtResult);

            matr.MatrixToGrid(dtResult);
            tbSum.Text       = search.MaxSum.ToString();
            dtStart.ReadOnly = true;
            changeVisible(true, false);
        }