private void twoRange_Click(object sender, EventArgs e)
        {
            Matrix matrix = new Matrix(twoDataGridView.Rows.Count, twoDataGridView.Columns.Count);

            for (int i = 0; i < twoDataGridView.Rows.Count; i++)
            {
                for (int j = 0; j < twoDataGridView.Columns.Count; j++)
                {
                    if (twoDataGridView.Rows[i].Cells[j].Value == null)
                    {
                        matrix[i, j] = 0;
                    }
                    else
                    {
                        matrix[i, j] = double.Parse(twoDataGridView.Rows[i].Cells[j].Value.ToString());
                    }
                }
            }
            MessageBox.Show(FuncMatrix.Rank(matrix).ToString());
        }
        private void oneDeterminant_Click(object sender, EventArgs e)
        {
            Matrix matrix = new Matrix(oneDataGridView.Rows.Count, oneDataGridView.Columns.Count);

            for (int i = 0; i < oneDataGridView.Rows.Count; i++)
            {
                for (int j = 0; j < oneDataGridView.Columns.Count; j++)
                {
                    if (oneDataGridView.Rows[i].Cells[j].Value == null)
                    {
                        matrix[i, j] = 0;
                    }
                    else
                    {
                        matrix[i, j] = double.Parse(oneDataGridView.Rows[i].Cells[j].Value.ToString());
                    }
                }
            }
            MessageBox.Show(FuncMatrix.Determinant(matrix).ToString());
        }
        private void resultTriangle_Click(object sender, EventArgs e)
        {
            Matrix m = new Matrix(resultDataGridView.Rows.Count, resultDataGridView.Columns.Count);

            for (int i = 0; i < resultDataGridView.Rows.Count; i++)
            {
                for (int j = 0; j < resultDataGridView.Columns.Count; j++)
                {
                    if (resultDataGridView.Rows[i].Cells[j].Value == null)
                    {
                        m[i, j] = 0;
                    }
                    else
                    {
                        m[i, j] = double.Parse(resultDataGridView.Rows[i].Cells[j].Value.ToString());
                    }
                }
            }
            ResultForm fr = new ResultForm(FuncMatrix.Triangle(m));

            fr.Show();
        }
 private void resultDeterminant_Click(object sender, EventArgs e)
 {
     MessageBox.Show(FuncMatrix.Determinant(matrix).ToString());
 }