diff --git a/Gauss.sln b/Gauss.sln
new file mode 100644
index 0000000..4135562
--- /dev/null
+++ b/Gauss.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28010.2019
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gauss", "Gauss\Gauss.csproj", "{57C4D1F2-DD71-4987-9160-5E8260556484}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {57C4D1F2-DD71-4987-9160-5E8260556484}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {57C4D1F2-DD71-4987-9160-5E8260556484}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {57C4D1F2-DD71-4987-9160-5E8260556484}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {57C4D1F2-DD71-4987-9160-5E8260556484}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {70A69724-3978-4877-99D8-9E91272B1968}
+ EndGlobalSection
+EndGlobal
diff --git a/Gauss/Gauss.cs b/Gauss/Gauss.cs
new file mode 100644
index 0000000..1edfce1
--- /dev/null
+++ b/Gauss/Gauss.cs
@@ -0,0 +1,133 @@
+using System;
+using System.Collections;
+using System.Data;
+
+namespace Gauss {
+ public class GaussSolutionNotFound : Exception {
+ public GaussSolutionNotFound(string msg)
+ : base(" : \r\n" + msg) {
+ }
+ }
+
+ public class LinearSystem {
+ private double[,] initial_a_matrix;
+ private double[,] a_matrix; // A
+ private double[] x_vector; // x
+ private double[] initial_b_vector;
+ private double[] b_vector; // b
+ private double eps; //
+ private int size; //
+
+
+ public LinearSystem(double[,] a_matrix, double[] b_vector)
+ : this(a_matrix, b_vector, 0.0001) {
+ }
+ public LinearSystem(double[,] a_matrix, double[] b_vector, double eps) {
+ if (a_matrix == null || b_vector == null)
+ throw new ArgumentNullException(" null.");
+
+ int b_length = b_vector.Length;
+ int a_length = a_matrix.Length;
+ if (a_length != b_length * b_length)
+ throw new ArgumentException(@" A B.");
+
+ this.initial_a_matrix = a_matrix; //
+ this.a_matrix = (double[,])a_matrix.Clone(); //
+ this.initial_b_vector = b_vector; //
+ this.b_vector = (double[])b_vector.Clone(); //
+ this.x_vector = new double[b_length];
+ this.size = b_length;
+ this.eps = eps;
+
+ GaussSolve();
+ }
+
+ public double[] XVector {
+ get {
+ return x_vector;
+ }
+ }
+
+ //
+ private int[] InitIndex() {
+ int[] index = new int[size];
+ for (int i = 0; i < index.Length; ++i)
+ index[i] = i;
+ return index;
+ }
+
+ //
+ private double FindR(int row, int[] index) {
+ int max_index = row;
+ double max = a_matrix[row, index[max_index]];
+ double max_abs = Math.Abs(max);
+ for (int cur_index = row + 1; cur_index < size; ++cur_index) {
+ double cur = a_matrix[row, index[cur_index]];
+ double cur_abs = Math.Abs(cur);
+ if (cur_abs > max_abs) {
+ max_index = cur_index;
+ max = cur;
+ max_abs = cur_abs;
+ }
+ }
+
+ if (max_abs < eps) {
+ if (Math.Abs(b_vector[row]) > eps)
+ throw new GaussSolutionNotFound(" .");
+ else
+ throw new GaussSolutionNotFound(" .");
+ }
+
+ //
+ int temp = index[row];
+ index[row] = index[max_index];
+ index[max_index] = temp;
+
+ return max;
+ }
+
+ //
+ private void GaussSolve() {
+ int[] index = InitIndex();
+ GaussForwardStroke(index);
+ GaussBackwardStroke(index);
+ GaussDiscrepancy();
+ }
+
+ //
+ private void GaussForwardStroke(int[] index) {
+ for (int i = 0; i < size; ++i) {
+ double r = FindR(i, index);
+ for (int j = 0; j < size; ++j)
+ a_matrix[i, j] /= r;
+ b_vector[i] /= r;
+ for (int k = i + 1; k < size; ++k) {
+ double p = a_matrix[k, index[i]];
+ for (int j = i; j < size; ++j)
+ a_matrix[k, index[j]] -= a_matrix[i, index[j]] * p;
+ b_vector[k] -= b_vector[i] * p;
+ a_matrix[k, index[i]] = 0.0;
+ }
+ }
+ }
+
+ //
+ private void GaussBackwardStroke(int[] index) {
+ for (int i = size - 1; i >= 0; --i) {
+ double x_i = b_vector[i];
+ for (int j = i + 1; j < size; ++j)
+ x_i -= x_vector[index[j]] * a_matrix[i, index[j]];
+ x_vector[index[i]] = x_i;
+ }
+ }
+
+ // x - ,
+ private void GaussDiscrepancy() {
+ for (int i = 0; i < size; ++i) {
+ double actual_b_i = 0.0;
+ for (int j = 0; j < size; ++j)
+ actual_b_i += initial_a_matrix[i, j] * x_vector[j];
+ }
+ }
+ }
+}
diff --git a/Gauss/Gauss.csproj b/Gauss/Gauss.csproj
new file mode 100644
index 0000000..b1a0d1a
--- /dev/null
+++ b/Gauss/Gauss.csproj
@@ -0,0 +1,90 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {57C4D1F2-DD71-4987-9160-5E8260556484}
+ WinExe
+ Properties
+ Gauss
+ Gauss
+ v4.6.1
+
+
+
+
+ 2.0
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ false
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+ false
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ MainForm.cs
+
+
+
+
+
+ Designer
+ MainForm.cs
+
+
+ ResXFileCodeGenerator
+ Designer
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
\ No newline at end of file
diff --git a/Gauss/MainForm.Designer.cs b/Gauss/MainForm.Designer.cs
new file mode 100644
index 0000000..4608b23
--- /dev/null
+++ b/Gauss/MainForm.Designer.cs
@@ -0,0 +1,223 @@
+namespace Gauss {
+ partial class MainForm {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.layoutMatrixA = new System.Windows.Forms.TableLayoutPanel();
+ this.layoutVectorX = new System.Windows.Forms.TableLayoutPanel();
+ this.layoutVectorB = new System.Windows.Forms.TableLayoutPanel();
+ this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
+ this.label1 = new System.Windows.Forms.Label();
+ this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
+ this.button1 = new System.Windows.Forms.Button();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.label4 = new System.Windows.Forms.Label();
+ this.tableLayoutPanel1.SuspendLayout();
+ this.flowLayoutPanel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 3;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.Controls.Add(this.layoutMatrixA, 0, 2);
+ this.tableLayoutPanel1.Controls.Add(this.layoutVectorX, 1, 2);
+ this.tableLayoutPanel1.Controls.Add(this.layoutVectorB, 2, 2);
+ this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
+ this.tableLayoutPanel1.Controls.Add(this.label3, 1, 1);
+ this.tableLayoutPanel1.Controls.Add(this.label4, 2, 1);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 3;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(647, 275);
+ this.tableLayoutPanel1.TabIndex = 2;
+ //
+ // layoutMatrixA
+ //
+ this.layoutMatrixA.ColumnCount = 1;
+ this.layoutMatrixA.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.layoutMatrixA.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.layoutMatrixA.Location = new System.Drawing.Point(3, 51);
+ this.layoutMatrixA.Name = "layoutMatrixA";
+ this.layoutMatrixA.RowCount = 1;
+ this.layoutMatrixA.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.layoutMatrixA.Size = new System.Drawing.Size(514, 221);
+ this.layoutMatrixA.TabIndex = 0;
+ //
+ // layoutVectorX
+ //
+ this.layoutVectorX.CausesValidation = false;
+ this.layoutVectorX.ColumnCount = 1;
+ this.layoutVectorX.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
+ this.layoutVectorX.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.layoutVectorX.Location = new System.Drawing.Point(523, 51);
+ this.layoutVectorX.Name = "layoutVectorX";
+ this.layoutVectorX.RowCount = 1;
+ this.layoutVectorX.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+ this.layoutVectorX.Size = new System.Drawing.Size(54, 221);
+ this.layoutVectorX.TabIndex = 1;
+ //
+ // layoutVectorB
+ //
+ this.layoutVectorB.ColumnCount = 1;
+ this.layoutVectorB.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
+ this.layoutVectorB.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.layoutVectorB.Location = new System.Drawing.Point(583, 51);
+ this.layoutVectorB.Name = "layoutVectorB";
+ this.layoutVectorB.RowCount = 1;
+ this.layoutVectorB.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+ this.layoutVectorB.Size = new System.Drawing.Size(61, 221);
+ this.layoutVectorB.TabIndex = 2;
+ //
+ // flowLayoutPanel1
+ //
+ this.flowLayoutPanel1.AutoSize = true;
+ this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 3);
+ this.flowLayoutPanel1.Controls.Add(this.label1);
+ this.flowLayoutPanel1.Controls.Add(this.numericUpDown1);
+ this.flowLayoutPanel1.Controls.Add(this.button1);
+ this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+ this.flowLayoutPanel1.Name = "flowLayoutPanel1";
+ this.flowLayoutPanel1.Size = new System.Drawing.Size(641, 29);
+ this.flowLayoutPanel1.TabIndex = 4;
+ //
+ // label1
+ //
+ this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(3, 8);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(75, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "";
+ //
+ // numericUpDown1
+ //
+ this.numericUpDown1.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.numericUpDown1.Location = new System.Drawing.Point(84, 4);
+ this.numericUpDown1.Maximum = new decimal(new int[] {
+ 15,
+ 0,
+ 0,
+ 0});
+ this.numericUpDown1.Minimum = new decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 0});
+ this.numericUpDown1.Name = "numericUpDown1";
+ this.numericUpDown1.Size = new System.Drawing.Size(87, 20);
+ this.numericUpDown1.TabIndex = 1;
+ this.numericUpDown1.Value = new decimal(new int[] {
+ 3,
+ 0,
+ 0,
+ 0});
+ this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
+ //
+ // button1
+ //
+ this.button1.Anchor = System.Windows.Forms.AnchorStyles.Left;
+ this.button1.Location = new System.Drawing.Point(177, 3);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 2;
+ this.button1.Text = "";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // label2
+ //
+ this.label2.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(229, 35);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(61, 13);
+ this.label2.TabIndex = 5;
+ this.label2.Text = " A";
+ //
+ // label3
+ //
+ this.label3.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(543, 35);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(14, 13);
+ this.label3.TabIndex = 6;
+ this.label3.Text = "X";
+ //
+ // label4
+ //
+ this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(583, 35);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(61, 13);
+ this.label4.TabIndex = 7;
+ this.label4.Text = " B";
+ //
+ // MainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(647, 275);
+ this.Controls.Add(this.tableLayoutPanel1);
+ this.Name = "MainForm";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = " ";
+ this.Load += new System.EventHandler(this.MainForm_Load);
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
+ this.flowLayoutPanel1.ResumeLayout(false);
+ this.flowLayoutPanel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+ private System.Windows.Forms.TableLayoutPanel layoutMatrixA;
+ private System.Windows.Forms.TableLayoutPanel layoutVectorX;
+ private System.Windows.Forms.TableLayoutPanel layoutVectorB;
+ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.NumericUpDown numericUpDown1;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Label label4;
+ }
+}
+
diff --git a/Gauss/MainForm.cs b/Gauss/MainForm.cs
new file mode 100644
index 0000000..46eafe1
--- /dev/null
+++ b/Gauss/MainForm.cs
@@ -0,0 +1,221 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace Gauss
+{
+ public partial class MainForm : Form
+ {
+
+ public MainForm()
+ {
+ InitializeComponent();
+ }
+
+ private string DefaultText = String.Format("{0:f}", 0.0);
+
+ //
+ private TextBox InitTextBox(bool readOnly)
+ {
+ TextBox textBox = new TextBox();
+ textBox.Anchor = AnchorStyles.Left | AnchorStyles.Right;
+ textBox.Text = DefaultText;
+ textBox.ReadOnly = readOnly;
+ if (!readOnly)
+ {
+ textBox.CausesValidation = true;
+ textBox.Validating += ValidateTextBox;
+ }
+ return textBox;
+ }
+
+ //
+ private void ValidateTextBox(object sender, CancelEventArgs e)
+ {
+ TextBox textBox = (TextBox)sender;
+ double result;
+ e.Cancel = !double.TryParse(textBox.Text, out result);
+ }
+
+ // ,
+ private TextBox[,] InitTextBoxMatrix(TableLayoutPanel layoutPanel, int count, bool readOnly)
+ {
+ layoutPanel.SuspendLayout();
+
+ layoutPanel.Controls.Clear();
+
+ layoutPanel.ColumnStyles.Clear();
+ layoutPanel.ColumnCount = count;
+
+ layoutPanel.RowStyles.Clear();
+ layoutPanel.RowCount = count;
+
+ TextBox[,] result = new TextBox[count, count];
+ float cellSize = 1f / count * 100f;
+
+ for (int col = 0; col < count; ++col)
+ {
+ layoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, cellSize));
+ for (int row = 0; row < count; ++row)
+ {
+ layoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, cellSize));
+
+ TextBox textBox = InitTextBox(readOnly);
+
+ layoutPanel.Controls.Add(textBox, col, row);
+ result[col, row] = textBox;
+ }
+ }
+
+ layoutPanel.ResumeLayout(true);
+
+ return result;
+ }
+
+ // ,
+ private TextBox[] InitTextBoxArray(TableLayoutPanel layoutPanel, int count, bool readOnly)
+ {
+ layoutPanel.SuspendLayout();
+
+ layoutPanel.Controls.Clear();
+
+ layoutPanel.ColumnStyles.Clear();
+ layoutPanel.ColumnCount = 1;
+
+ layoutPanel.RowStyles.Clear();
+ layoutPanel.RowCount = count;
+
+ TextBox[] result = new TextBox[count];
+ float cellSize = 1f / count * 100f;
+
+ layoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
+
+ for (int row = 0; row < count; ++row)
+ {
+ layoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, cellSize));
+
+ TextBox textBox = InitTextBox(readOnly);
+
+ layoutPanel.Controls.Add(textBox, 0, row);
+ result[row] = textBox;
+ }
+
+ layoutPanel.ResumeLayout(true);
+
+ return result;
+ }
+
+ private int n;
+ private TextBox[,] matrixA;
+ private TextBox[] vectorB;
+ private TextBox[] vectorX;
+
+ private void InitMatrixA()
+ {
+ matrixA = InitTextBoxMatrix(layoutMatrixA, n, false);
+ }
+
+ private void InitVectorX()
+ {
+ vectorX = InitTextBoxArray(layoutVectorX, n, true);
+ }
+
+ private void InitVectorB()
+ {
+ vectorB = InitTextBoxArray(layoutVectorB, n, false);
+ }
+
+ public int N
+ {
+ get { return n; }
+ set
+ {
+ if (value != n && value > 0)
+ {
+ n = value;
+ InitMatrixA();
+ InitVectorX();
+ InitVectorB();
+ }
+ }
+ }
+
+ private void MainForm_Load(object sender, EventArgs e)
+ {
+ N = (int)numericUpDown1.Value;
+ }
+
+ private void numericUpDown1_ValueChanged(object sender, EventArgs e)
+ {
+ N = (int)numericUpDown1.Value;
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if (Validate())
+ {
+ try
+ {
+ LinearSystem system = new LinearSystem(MatrixA, VectorB);
+ VectorX = system.XVector;
+ }
+ catch (Exception error)
+ {
+ MessageBox.Show(error.Message);
+ }
+ }
+ }
+
+ public double[,] MatrixA
+ {
+ get
+ {
+ // A
+ double[,] matrix_a = new double[n, n];
+ for (int i = 0; i < n; ++i)
+ for (int j = 0; j < n; ++j)
+ matrix_a[i, j] = double.Parse(matrixA[j, i].Text);
+ return matrix_a;
+ }
+ set
+ {
+ // A
+ for (int i = 0; i < n; ++i)
+ for (int j = 0; j < n; ++j)
+ matrixA[j, i].Text = value[i, j].ToString("f");
+ }
+ }
+
+ public double[] VectorB
+ {
+ get
+ {
+ // B
+ double[] vector_b = new double[n];
+ for (int j = 0; j < n; ++j)
+ vector_b[j] = double.Parse(vectorB[j].Text);
+ return vector_b;
+ }
+ set
+ {
+ // B
+ for (int j = 0; j < n; ++j)
+ vectorB[j].Text = value[j].ToString("f");
+ }
+ }
+
+ public double[] VectorX
+ {
+ set
+ {
+ // X
+ for (int j = 0; j < n; ++j)
+ vectorX[j].Text = value[j].ToString("f");
+ }
+ }
+ }
+}
diff --git a/Gauss/MainForm.resx b/Gauss/MainForm.resx
new file mode 100644
index 0000000..c7e0d4b
--- /dev/null
+++ b/Gauss/MainForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Gauss/Program.cs b/Gauss/Program.cs
new file mode 100644
index 0000000..416f276
--- /dev/null
+++ b/Gauss/Program.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace Gauss {
+ static class Program {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main() {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MainForm());
+ }
+ }
+}
\ No newline at end of file
diff --git a/Gauss/Properties/AssemblyInfo.cs b/Gauss/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..567556b
--- /dev/null
+++ b/Gauss/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Gauss")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("University \"Dubna\"")]
+[assembly: AssemblyProduct("Gauss")]
+[assembly: AssemblyCopyright("Copyright © University \"Dubna\" 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("55307c61-fda7-441f-805b-a41665e04f34")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Gauss/Properties/Resources.Designer.cs b/Gauss/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..ef1dea8
--- /dev/null
+++ b/Gauss/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// Этот код создан программой.
+// Исполняемая версия:4.0.30319.42000
+//
+// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+// повторной генерации кода.
+//
+//------------------------------------------------------------------------------
+
+namespace Gauss.Properties {
+ using System;
+
+
+ ///
+ /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
+ ///
+ // Этот класс создан автоматически классом StronglyTypedResourceBuilder
+ // с помощью такого средства, как ResGen или Visual Studio.
+ // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
+ // с параметром /str или перестройте свой проект VS.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Gauss.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Перезаписывает свойство CurrentUICulture текущего потока для всех
+ /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Gauss/Properties/Resources.resx b/Gauss/Properties/Resources.resx
new file mode 100644
index 0000000..ffecec8
--- /dev/null
+++ b/Gauss/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Gauss/Properties/Settings.Designer.cs b/Gauss/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..66d1223
--- /dev/null
+++ b/Gauss/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// Этот код создан программой.
+// Исполняемая версия:4.0.30319.42000
+//
+// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+// повторной генерации кода.
+//
+//------------------------------------------------------------------------------
+
+namespace Gauss.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Gauss/Properties/Settings.settings b/Gauss/Properties/Settings.settings
new file mode 100644
index 0000000..abf36c5
--- /dev/null
+++ b/Gauss/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Gauss/app.config b/Gauss/app.config
new file mode 100644
index 0000000..d405098
--- /dev/null
+++ b/Gauss/app.config
@@ -0,0 +1,3 @@
+
+
+
diff --git a/Gauss/bin/Debug/Gauss.exe b/Gauss/bin/Debug/Gauss.exe
new file mode 100644
index 0000000..41bd552
Binary files /dev/null and b/Gauss/bin/Debug/Gauss.exe differ
diff --git a/Gauss/bin/Debug/Gauss.exe.config b/Gauss/bin/Debug/Gauss.exe.config
new file mode 100644
index 0000000..d405098
--- /dev/null
+++ b/Gauss/bin/Debug/Gauss.exe.config
@@ -0,0 +1,3 @@
+
+
+
diff --git a/Gauss/bin/Debug/Gauss.pdb b/Gauss/bin/Debug/Gauss.pdb
new file mode 100644
index 0000000..bfce623
Binary files /dev/null and b/Gauss/bin/Debug/Gauss.pdb differ
diff --git a/Gauss/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Gauss/obj/Debug/DesignTimeResolveAssemblyReferences.cache
new file mode 100644
index 0000000..88b2adf
Binary files /dev/null and b/Gauss/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ
diff --git a/Gauss/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Gauss/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..a03d8f7
Binary files /dev/null and b/Gauss/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/Gauss/obj/Debug/Gauss.MainForm.resources b/Gauss/obj/Debug/Gauss.MainForm.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/Gauss/obj/Debug/Gauss.MainForm.resources differ
diff --git a/Gauss/obj/Debug/Gauss.Properties.Resources.resources b/Gauss/obj/Debug/Gauss.Properties.Resources.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/Gauss/obj/Debug/Gauss.Properties.Resources.resources differ
diff --git a/Gauss/obj/Debug/Gauss.csproj.CoreCompileInputs.cache b/Gauss/obj/Debug/Gauss.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..115e59b
--- /dev/null
+++ b/Gauss/obj/Debug/Gauss.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+8877119b8aa87b15fd8a8d94be7156ed54ac6603
diff --git a/Gauss/obj/Debug/Gauss.csproj.FileListAbsolute.txt b/Gauss/obj/Debug/Gauss.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..4a893fa
--- /dev/null
+++ b/Gauss/obj/Debug/Gauss.csproj.FileListAbsolute.txt
@@ -0,0 +1,10 @@
+E:\Gauss\Gauss\bin\Debug\Gauss.exe.config
+E:\Gauss\Gauss\bin\Debug\Gauss.exe
+E:\Gauss\Gauss\bin\Debug\Gauss.pdb
+E:\Gauss\Gauss\obj\Debug\Gauss.csprojAssemblyReference.cache
+E:\Gauss\Gauss\obj\Debug\Gauss.MainForm.resources
+E:\Gauss\Gauss\obj\Debug\Gauss.Properties.Resources.resources
+E:\Gauss\Gauss\obj\Debug\Gauss.csproj.GenerateResource.cache
+E:\Gauss\Gauss\obj\Debug\Gauss.csproj.CoreCompileInputs.cache
+E:\Gauss\Gauss\obj\Debug\Gauss.exe
+E:\Gauss\Gauss\obj\Debug\Gauss.pdb
diff --git a/Gauss/obj/Debug/Gauss.csproj.GenerateResource.cache b/Gauss/obj/Debug/Gauss.csproj.GenerateResource.cache
new file mode 100644
index 0000000..970022c
Binary files /dev/null and b/Gauss/obj/Debug/Gauss.csproj.GenerateResource.cache differ
diff --git a/Gauss/obj/Debug/Gauss.csprojAssemblyReference.cache b/Gauss/obj/Debug/Gauss.csprojAssemblyReference.cache
new file mode 100644
index 0000000..2c986f0
Binary files /dev/null and b/Gauss/obj/Debug/Gauss.csprojAssemblyReference.cache differ
diff --git a/Gauss/obj/Debug/Gauss.exe b/Gauss/obj/Debug/Gauss.exe
new file mode 100644
index 0000000..41bd552
Binary files /dev/null and b/Gauss/obj/Debug/Gauss.exe differ
diff --git a/Gauss/obj/Debug/Gauss.pdb b/Gauss/obj/Debug/Gauss.pdb
new file mode 100644
index 0000000..bfce623
Binary files /dev/null and b/Gauss/obj/Debug/Gauss.pdb differ
diff --git a/Gauss/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/Gauss/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll
new file mode 100644
index 0000000..d63a1c5
Binary files /dev/null and b/Gauss/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll differ
diff --git a/Gauss/obj/Release/Gauss.AboutBox.resources b/Gauss/obj/Release/Gauss.AboutBox.resources
new file mode 100644
index 0000000..1425465
Binary files /dev/null and b/Gauss/obj/Release/Gauss.AboutBox.resources differ
diff --git a/Gauss/obj/Release/Gauss.MainForm.resources b/Gauss/obj/Release/Gauss.MainForm.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/Gauss/obj/Release/Gauss.MainForm.resources differ
diff --git a/Gauss/obj/Release/Gauss.Properties.Resources.resources b/Gauss/obj/Release/Gauss.Properties.Resources.resources
new file mode 100644
index 0000000..6c05a97
Binary files /dev/null and b/Gauss/obj/Release/Gauss.Properties.Resources.resources differ
diff --git a/Gauss/obj/Release/Gauss.csproj.CoreCompileInputs.cache b/Gauss/obj/Release/Gauss.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..1967f65
--- /dev/null
+++ b/Gauss/obj/Release/Gauss.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+72e634e4acd1a8eafc300c8ea5f0ec1915c056b6
diff --git a/Gauss/obj/Release/Gauss.csproj.FileListAbsolute.txt b/Gauss/obj/Release/Gauss.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..827cec2
--- /dev/null
+++ b/Gauss/obj/Release/Gauss.csproj.FileListAbsolute.txt
@@ -0,0 +1,11 @@
+E:\Gauss\Gauss\bin\Release\Gauss.exe.config
+E:\Gauss\Gauss\bin\Release\Gauss.exe
+E:\Gauss\Gauss\bin\Release\Gauss.pdb
+E:\Gauss\Gauss\obj\Release\Gauss.csprojAssemblyReference.cache
+E:\Gauss\Gauss\obj\Release\Gauss.AboutBox.resources
+E:\Gauss\Gauss\obj\Release\Gauss.MainForm.resources
+E:\Gauss\Gauss\obj\Release\Gauss.Properties.Resources.resources
+E:\Gauss\Gauss\obj\Release\Gauss.csproj.GenerateResource.cache
+E:\Gauss\Gauss\obj\Release\Gauss.csproj.CoreCompileInputs.cache
+E:\Gauss\Gauss\obj\Release\Gauss.exe
+E:\Gauss\Gauss\obj\Release\Gauss.pdb
diff --git a/Gauss/obj/Release/Gauss.csproj.GenerateResource.cache b/Gauss/obj/Release/Gauss.csproj.GenerateResource.cache
new file mode 100644
index 0000000..506daea
Binary files /dev/null and b/Gauss/obj/Release/Gauss.csproj.GenerateResource.cache differ
diff --git a/Gauss/obj/Release/Gauss.csprojAssemblyReference.cache b/Gauss/obj/Release/Gauss.csprojAssemblyReference.cache
new file mode 100644
index 0000000..65c6149
Binary files /dev/null and b/Gauss/obj/Release/Gauss.csprojAssemblyReference.cache differ
diff --git a/Gauss/obj/Release/Gauss.exe b/Gauss/obj/Release/Gauss.exe
new file mode 100644
index 0000000..2d9aa61
Binary files /dev/null and b/Gauss/obj/Release/Gauss.exe differ
diff --git a/Gauss/obj/Release/Gauss.pdb b/Gauss/obj/Release/Gauss.pdb
new file mode 100644
index 0000000..3c35a15
Binary files /dev/null and b/Gauss/obj/Release/Gauss.pdb differ
diff --git a/Gauss/obj/Release/TempPE/Properties.Resources.Designer.cs.dll b/Gauss/obj/Release/TempPE/Properties.Resources.Designer.cs.dll
new file mode 100644
index 0000000..7fb9f56
Binary files /dev/null and b/Gauss/obj/Release/TempPE/Properties.Resources.Designer.cs.dll differ