private void Button_Click(object sender, RoutedEventArgs e) { double min; string str; matrix = new LossMatrix(); minimax = new Minimax(matrix); minimaxGrid.ItemsSource = minimax.FindDecision(out str, out min); minimaxLable.Content = "Минимаксный критерий: " + str + ": " + min; }
private void GetData() { sourceMatrix = new List <TableLossMatrix>(); string str = ""; str = tbSNume.Text + tbName.Text; if (str.Length % 2 == 0) { row = str.Length / column; } else { str += "И"; row = str.Length / column; } matrix = new LossMatrix(row, column); data = new double[LossMatrix.RowCount, LossMatrix.ColumnCount]; int strStep = 0; int temp; for (int i = 0; i < LossMatrix.RowCount; i++) { for (int j = 0; j < LossMatrix.ColumnCount; j++) { if ((alphabet.GetNumber(str[strStep]).ToString().Length == 2)) { data[i, j] = ((alphabet.GetNumber(str[strStep])) % 10); } else { data[i, j] = alphabet.GetNumber(str[strStep]); } data[i, j] /= 10; strStep++; } temp = i; sourceMatrix.Add(new TableLossMatrix("α" + ++temp, data[i, 0], data[i, 1])); } matrix.Matrix = data; gridSourceMatrix.ItemsSource = sourceMatrix; }
///////////////////////// public HurwiczCriterion(LossMatrix matrix) { this.matrix = matrix.Matrix; }
public Minimax(LossMatrix matrix) { this.matrix = matrix.Matrix; }