|
@@ -20,10 +20,6 @@ namespace MatrixXAMLOnly
|
|
{
|
|
{
|
|
InitializeComponent();
|
|
InitializeComponent();
|
|
|
|
|
|
- DiagramWindow wnd = new DiagramWindow();
|
|
|
|
- wnd.Show();
|
|
|
|
- Close();
|
|
|
|
-
|
|
|
|
BtnAddition.Content = "Сложение матриц";
|
|
BtnAddition.Content = "Сложение матриц";
|
|
BtnDifference.Content = "Вычитание матриц";
|
|
BtnDifference.Content = "Вычитание матриц";
|
|
BtnMultiplicationOnScalar.Content = "Умножение матрицы \nна скаляр";
|
|
BtnMultiplicationOnScalar.Content = "Умножение матрицы \nна скаляр";
|
|
@@ -407,6 +403,24 @@ namespace MatrixXAMLOnly
|
|
GridAdditionScndTerm.Children.Add(CreateMatrix(rowCount, columnCount, false));
|
|
GridAdditionScndTerm.Children.Add(CreateMatrix(rowCount, columnCount, false));
|
|
GridAdditionResult.Children.Add(CreateMatrix(rowCount, columnCount, true));
|
|
GridAdditionResult.Children.Add(CreateMatrix(rowCount, columnCount, true));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void BtnAdditionDiagramm_Click(object sender, RoutedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ int rowCount = ((Grid)GridAdditionResult.Children[0]).RowDefinitions.Count;
|
|
|
|
+ int columnCount = ((Grid)GridAdditionResult.Children[0]).ColumnDefinitions.Count;
|
|
|
|
+
|
|
|
|
+ double[,] result = new double[rowCount, columnCount];
|
|
|
|
+ for (int i = 0; i < rowCount; i++)
|
|
|
|
+ {
|
|
|
|
+ for (int j = 0; j < columnCount; j++)
|
|
|
|
+ {
|
|
|
|
+ result[i, j] = Convert.ToDouble(((Grid)GridAdditionResult.Children[0]).Children.Cast<TextBox>().First(e => Grid.GetColumn(e) == j && Grid.GetRow(e) == i).Text);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DiagramWindow wnd = new DiagramWindow(new MyMatrix(result));
|
|
|
|
+ wnd.Show();
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region Difference
|
|
#region Difference
|
|
@@ -471,6 +485,24 @@ namespace MatrixXAMLOnly
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void BtnDifferenceDiagramm_Click(object sender, RoutedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ int rowCount = ((Grid)GridDifferenceResult.Children[0]).RowDefinitions.Count;
|
|
|
|
+ int columnCount = ((Grid)GridDifferenceResult.Children[0]).ColumnDefinitions.Count;
|
|
|
|
+
|
|
|
|
+ double[,] result = new double[rowCount, columnCount];
|
|
|
|
+ for (int i = 0; i < rowCount; i++)
|
|
|
|
+ {
|
|
|
|
+ for (int j = 0; j < columnCount; j++)
|
|
|
|
+ {
|
|
|
|
+ result[i, j] = Convert.ToDouble(((Grid)GridDifferenceResult.Children[0]).Children.Cast<TextBox>().First(e => Grid.GetColumn(e) == j && Grid.GetRow(e) == i).Text);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DiagramWindow wnd = new DiagramWindow(new MyMatrix(result));
|
|
|
|
+ wnd.Show();
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region MultiplicationOnScalar
|
|
#region MultiplicationOnScalar
|
|
@@ -541,6 +573,24 @@ namespace MatrixXAMLOnly
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void BtnMultiplicationOnScalarnDiagramm_Click(object sender, RoutedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ int rowCount = ((Grid)GridMultiplicationOnScalarResult.Children[0]).RowDefinitions.Count;
|
|
|
|
+ int columnCount = ((Grid)GridMultiplicationOnScalarResult.Children[0]).ColumnDefinitions.Count;
|
|
|
|
+
|
|
|
|
+ double[,] result = new double[rowCount, columnCount];
|
|
|
|
+ for (int i = 0; i < rowCount; i++)
|
|
|
|
+ {
|
|
|
|
+ for (int j = 0; j < columnCount; j++)
|
|
|
|
+ {
|
|
|
|
+ result[i, j] = Convert.ToDouble(((Grid)GridMultiplicationOnScalarResult.Children[0]).Children.Cast<TextBox>().First(e => Grid.GetColumn(e) == j && Grid.GetRow(e) == i).Text);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DiagramWindow wnd = new DiagramWindow(new MyMatrix(result));
|
|
|
|
+ wnd.Show();
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region Transposition
|
|
#region Transposition
|
|
@@ -600,6 +650,24 @@ namespace MatrixXAMLOnly
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void BtnTranspositionDiagramm_Click(object sender, RoutedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ int rowCount = ((Grid)GridTransposed.Children[0]).RowDefinitions.Count;
|
|
|
|
+ int columnCount = ((Grid)GridTransposed.Children[0]).ColumnDefinitions.Count;
|
|
|
|
+
|
|
|
|
+ double[,] result = new double[rowCount, columnCount];
|
|
|
|
+ for (int i = 0; i < rowCount; i++)
|
|
|
|
+ {
|
|
|
|
+ for (int j = 0; j < columnCount; j++)
|
|
|
|
+ {
|
|
|
|
+ result[i, j] = Convert.ToDouble(((Grid)GridTransposed.Children[0]).Children.Cast<TextBox>().First(e => Grid.GetColumn(e) == j && Grid.GetRow(e) == i).Text);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DiagramWindow wnd = new DiagramWindow(new MyMatrix(result));
|
|
|
|
+ wnd.Show();
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region MultiplicationOnTransposed
|
|
#region MultiplicationOnTransposed
|
|
@@ -660,6 +728,24 @@ namespace MatrixXAMLOnly
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void BtnMultiplicationOnTransposedDiagramm_Click(object sender, RoutedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ int rowCount = ((Grid)GridMultiplicationOnTransposedResult.Children[0]).RowDefinitions.Count;
|
|
|
|
+ int columnCount = ((Grid)GridMultiplicationOnTransposedResult.Children[0]).ColumnDefinitions.Count;
|
|
|
|
+
|
|
|
|
+ double[,] result = new double[rowCount, columnCount];
|
|
|
|
+ for (int i = 0; i < rowCount; i++)
|
|
|
|
+ {
|
|
|
|
+ for (int j = 0; j < columnCount; j++)
|
|
|
|
+ {
|
|
|
|
+ result[i, j] = Convert.ToDouble(((Grid)GridMultiplicationOnTransposedResult.Children[0]).Children.Cast<TextBox>().First(e => Grid.GetColumn(e) == j && Grid.GetRow(e) == i).Text);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DiagramWindow wnd = new DiagramWindow(new MyMatrix(result));
|
|
|
|
+ wnd.Show();
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region RowReplace
|
|
#region RowReplace
|
|
@@ -719,6 +805,24 @@ namespace MatrixXAMLOnly
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void BtnRowsReplaceDiagramm_Click(object sender, RoutedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ int rowCount = ((Grid)GridRowsReplaceResult.Children[0]).RowDefinitions.Count;
|
|
|
|
+ int columnCount = ((Grid)GridRowsReplaceResult.Children[0]).ColumnDefinitions.Count;
|
|
|
|
+
|
|
|
|
+ double[,] result = new double[rowCount, columnCount];
|
|
|
|
+ for (int i = 0; i < rowCount; i++)
|
|
|
|
+ {
|
|
|
|
+ for (int j = 0; j < columnCount; j++)
|
|
|
|
+ {
|
|
|
|
+ result[i, j] = Convert.ToDouble(((Grid)GridRowsReplaceResult.Children[0]).Children.Cast<TextBox>().First(e => Grid.GetColumn(e) == j && Grid.GetRow(e) == i).Text);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DiagramWindow wnd = new DiagramWindow(new MyMatrix(result));
|
|
|
|
+ wnd.Show();
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region RowTranspositionReplace
|
|
#region RowTranspositionReplace
|
|
@@ -807,6 +911,24 @@ namespace MatrixXAMLOnly
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void BtnRowTranspositionReplaceDiagramm_Click(object sender, RoutedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ int rowCount = ((Grid)GridRowTranspositionReplaceResult.Children[0]).RowDefinitions.Count;
|
|
|
|
+ int columnCount = ((Grid)GridRowTranspositionReplaceResult.Children[0]).ColumnDefinitions.Count;
|
|
|
|
+
|
|
|
|
+ double[,] result = new double[rowCount, columnCount];
|
|
|
|
+ for (int i = 0; i < rowCount; i++)
|
|
|
|
+ {
|
|
|
|
+ for (int j = 0; j < columnCount; j++)
|
|
|
|
+ {
|
|
|
|
+ result[i, j] = Convert.ToDouble(((Grid)GridRowTranspositionReplaceResult.Children[0]).Children.Cast<TextBox>().First(e => Grid.GetColumn(e) == j && Grid.GetRow(e) == i).Text);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DiagramWindow wnd = new DiagramWindow(new MyMatrix(result));
|
|
|
|
+ wnd.Show();
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region Inverse
|
|
#region Inverse
|
|
@@ -875,6 +997,24 @@ namespace MatrixXAMLOnly
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void BtnInverseeDiagramm_Click(object sender, RoutedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ int rowCount = ((Grid)GridInverseResult.Children[0]).RowDefinitions.Count;
|
|
|
|
+ int columnCount = ((Grid)GridInverseResult.Children[0]).ColumnDefinitions.Count;
|
|
|
|
+
|
|
|
|
+ double[,] result = new double[rowCount, columnCount];
|
|
|
|
+ for (int i = 0; i < rowCount; i++)
|
|
|
|
+ {
|
|
|
|
+ for (int j = 0; j < columnCount; j++)
|
|
|
|
+ {
|
|
|
|
+ result[i, j] = Convert.ToDouble(((Grid)GridInverseResult.Children[0]).Children.Cast<TextBox>().First(e => Grid.GetColumn(e) == j && Grid.GetRow(e) == i).Text);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DiagramWindow wnd = new DiagramWindow(new MyMatrix(result));
|
|
|
|
+ wnd.Show();
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
}
|
|
}
|
|
}
|
|
}
|