49349 (609069), страница 4
Текст из файла (страница 4)
this.dataGrid1.ColumnHeadersVisible = false;
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(0, 19);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ParentRowsVisible = false;
this.dataGrid1.ReadOnly = true;
this.dataGrid1.RowHeadersVisible = false;
this.dataGrid1.Size = new System.Drawing.Size(561, 230);
this.dataGrid1.TabIndex = 6;
//
// dataGrid2
//
this.dataGrid2.AllowNavigation = false;
this.dataGrid2.AllowSorting = false;
this.dataGrid2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGrid2.CaptionVisible = false;
this.dataGrid2.ColumnHeadersVisible = false;
this.dataGrid2.DataMember = "";
this.dataGrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid2.Location = new System.Drawing.Point(0, 266);
this.dataGrid2.Name = "dataGrid2";
this.dataGrid2.ParentRowsVisible = false;
this.dataGrid2.ReadOnly = true;
this.dataGrid2.RowHeadersVisible = false;
this.dataGrid2.Size = new System.Drawing.Size(561, 231);
this.dataGrid2.TabIndex = 7;
//
// fastLine2
//
//
//
//
this.fastLine2.LinePen.Color = System.Drawing.Color.Green;
this.fastLine2.Marks.Callout.ArrowHead = Steema.TeeChart.Styles.ArrowHeadStyles.None;
this.fastLine2.Marks.Callout.ArrowHeadSize = 8;
//
//
//
this.fastLine2.Marks.Callout.Brush.Color = System.Drawing.Color.Black;
this.fastLine2.Marks.Callout.Distance = 0;
this.fastLine2.Marks.Callout.Draw3D = false;
this.fastLine2.Marks.Callout.Length = 10;
this.fastLine2.Marks.Callout.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle;
this.fastLine2.Marks.Font.Shadow.Visible = false;
this.fastLine2.Title = "Щiльнicть рoзпoдiлу ймoвiрнocтей";
//
//
//
this.fastLine2.XValues.DataMember = "X";
this.fastLine2.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
//
//
//
this.fastLine2.YValues.DataMember = "Y";
//
// points1
this.points1.LinePen.Color = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.points1.Marks.Callout.ArrowHead = Steema.TeeChart.Styles.ArrowHeadStyles.None;
this.points1.Marks.Callout.ArrowHeadSize = 8;
//
//
//
this.points1.Marks.Callout.Brush.Color = System.Drawing.Color.Black;
this.points1.Marks.Callout.Distance = 0;
this.points1.Marks.Callout.Draw3D = false;
this.points1.Marks.Callout.Length = 0;
this.points1.Marks.Callout.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle;
this.points1.Marks.Font.Shadow.Visible = false;
this.points1.Pointer.Brush.Color = System.Drawing.Color.Red;
this.points1.Pointer.HorizSize = 2;
this.points1.Pointer.Pen.Color = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.points1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
this.points1.Pointer.VertSize = 2;
this.points1.Pointer.Visible = true;
this.points1.Title = "Значення ймoвiрнocтей";
this.points1.XValues.DataMember = "X";
this.points1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
//
//
//
this.points1.YValues.DataMember = "Y";
//
// tChart1
//
this.tChart1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.tChart1.Aspect.ElevationFloat = 345;
this.tChart1.Aspect.RotationFloat = 345;
this.tChart1.Aspect.View3D = false;
this.tChart1.Axes.Bottom.Automatic = true;
this.tChart1.Axes.Bottom.Grid.ZPosition = 0;
this.tChart1.Axes.Bottom.Labels.Font.Shadow.Visible = false;
this.tChart1.Axes.Bottom.Labels.Shadow.Visible = false;
this.tChart1.Axes.Bottom.Title.Font.Shadow.Visible = false;
this.tChart1.Axes.Bottom.Title.Shadow.Visible = false;
//
//
//
this.tChart1.Axes.Depth.Automatic = true;
this.tChart1.Axes.Depth.Grid.ZPosition = 0;
this.tChart1.Axes.Depth.Labels.Font.Shadow.Visible = false;
//
//
//
this.tChart1.Axes.Depth.Labels.Shadow.Visible = false;
this.tChart1.Axes.Depth.Title.Font.Shadow.Visible = false;
this.tChart1.Axes.Depth.Title.Shadow.Visible = false;
this.tChart1.Axes.DepthTop.Automatic = true;
this.tChart1.Axes.DepthTop.Grid.ZPosition = 0;
this.tChart1.Axes.DepthTop.Labels.Font.Shadow.Visible = false;
this.tChart1.Axes.DepthTop.Labels.Shadow.Visible = false;
this.tChart1.Axes.DepthTop.Title.Font.Shadow.Visible = false;
this.tChart1.Axes.DepthTop.Title.Shadow.Visible = false;
this.tChart1.Axes.Left.Automatic = true;
this.tChart1.Axes.Left.Grid.ZPosition = 0;
this.tChart1.Axes.Left.Labels.Font.Shadow.Visible = false;
this.tChart1.Axes.Left.Labels.Shadow.Visible = false;
this.tChart1.Axes.Left.Title.Font.Shadow.Visible = false;
this.tChart1.Axes.Left.Title.Shadow.Visible = false;
this.tChart1.Axes.Right.Automatic = true;
this.tChart1.Axes.Right.Grid.ZPosition = 0;
this.tChart1.Axes.Right.Labels.Font.Shadow.Visible = false;
this.tChart1.Axes.Right.Labels.Shadow.Visible = false;
this.tChart1.Axes.Right.Title.Font.Shadow.Visible = false;
this.tChart1.Axes.Right.Title.Shadow.Visible = false;
this.tChart1.Axes.Top.Automatic = true;
this.tChart1.Axes.Top.Grid.ZPosition = 0;
this.tChart1.Axes.Top.Labels.Font.Shadow.Visible = false;
this.tChart1.Axes.Top.Labels.Shadow.Visible = false;
this.tChart1.Axes.Top.Title.Font.Shadow.Visible = false;
this.tChart1.Axes.Top.Title.Shadow.Visible = false;
this.tChart1.Cursor = System.Windows.Forms.Cursors.Default;
this.tChart1.Footer.Font.Shadow.Visible = false;
this.tChart1.Footer.Shadow.Visible = false;
//
this.tChart1.Header.Font.Shadow.Visible = false;
this.tChart1.Header.Lines = new string[] {
""};
this.tChart1.Header.Shadow.Visible = false;
this.tChart1.Legend.Font.Shadow.Visible = false;
this.tChart1.Legend.Title.Font.Bold = true;
this.tChart1.Legend.Title.Font.Shadow.Visible = false;
this.tChart1.Legend.Title.Pen.Visible = false;
this.tChart1.Legend.Title.Shadow.Visible = false;
this.tChart1.Location = new System.Drawing.Point(567, 15);
this.tChart1.Name = "tChart1";
this.tChart1.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
this.tChart1.Panel.ImageBevel.Width = 1;
this.tChart1.Panel.Shadow.Visible = false;
this.tChart1.Series.Add(this.points1);
this.tChart1.Series.Add(this.fastLine2);
this.tChart1.Size = new System.Drawing.Size(483, 230);
this.tChart1.SubFooter.Font.Shadow.Visible = false;
this.tChart1.SubFooter.Shadow.Visible = false;
this.tChart1.SubHeader.Font.Shadow.Visible = false;
this.tChart1.SubHeader.Shadow.Visible = false;
this.tChart1.TabIndex = 0;
this.tChart1.Walls.Back.AutoHide = false;
this.tChart1.Walls.Back.Shadow.Visible = false;
this.tChart1.Walls.Bottom.AutoHide = false;
this.tChart1.Walls.Bottom.Shadow.Visible = false;
this.tChart1.Walls.Left.AutoHide = false;
this.tChart1.Walls.Left.Shadow.Visible = false;
this.tChart1.Walls.Right.AutoHide = false;
this.tChart1.Walls.Right.Shadow.Visible = false;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(-1, 2);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(61, 13);
this.label5.TabIndex = 8;
this.label5.Text = "Матриця Х";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(-1, 249);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(61, 13);
this.label6.TabIndex = 9;
this.label6.Text = "Матриця S";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(817, 116);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(196, 56);
this.pictureBox1.TabIndex = 10;
this.pictureBox1.TabStop = false;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(1062, 566);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.tChart1);
this.Controls.Add(this.dataGrid2);
this.Controls.Add(this.dataGrid1);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Критерiй Байєcа – Лаплаcа (матриця фoрмуєтьcя за екcпoненцiальним закoнoм). Курcoва" +
" рoбoта cтудента групи ПЗc-07-1 Кoчеткoва O.М.";
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
bl.lambda = Convert.ToDouble(numericUpDown1.Value);
//bl.delta = Convert.ToDouble(numericUpDown2.Value);
bl.I = Convert.ToInt32(numericUpDown3.Value);
bl.J = Convert.ToInt32(numericUpDown4.Value);
bl.Fill();
//MessageBox.Show("swsds");
bl.Find_v();
bl.Find_max_v();
textBox1.Text = bl.calc;
tChart1.Series[0].Clear();
tChart1.Series[1].Clear();
for (int i = 0; i < bl.I; i++)
{
for (int j = 0; j < bl.J; j++)
{
tChart1.Series[0].Add(bl.x[i,j], bl.y[i,j]);
tChart1.Series[1].Add(bl.x[i,j], bl.Find_F(bl.x[i,j]));
}
textBox1.Text += "\r\n";
}
DataTable dt = new DataTable("X_S");
DataSet ds = new DataSet("X");
DataTable dt1 = new DataTable("S");
for (int i = 1; i <= bl.J; i++)
{
dt.Columns.Add(i.ToString());
dt1.Columns.Add(i.ToString());
}
string[] s = new string[bl.J];
string[] s1 = new string[bl.J];
for (int i = 0; i < bl.I; i++)
{
for (int j = 0; j < bl.J; j++)
{
s[j] = String.Format(bl.format,bl.x[i,j]);
s1[j] = String.Format(bl.format,bl.y[i,j]);
}
dt.Rows.Add(s);
dt1.Rows.Add(s1);
}
ds.Tables.Add(dt);
dataGrid1.DataSource = ds.Tables[0];
dataGrid1.Expand(-1);
dataGrid1.SelectionBackColor = Color.SeaShell;
dataGrid1.SelectionBackColor = Color.Green;
dataGrid1.Select(bl.max_v[0]);
ds.Tables.Add(dt1);
dataGrid2.DataSource = ds.Tables[1];
dataGrid2.Expand(-1);
dataGrid2.SelectionBackColor = Color.SeaShell;
dataGrid2.SelectionBackColor = Color.Green;
dataGrid2.Select(bl.max_v[0]);
}
private void numericUpDown1_ValueChanged(object sender, System.EventArgs e)
{
bl.lambda = Convert.ToDouble(numericUpDown1.Value);
}
private void numericUpDown2_ValueChanged(object sender, System.EventArgs e)
{
bl.delta = Convert.ToDouble(numericUpDown2.Value);
}
private void numericUpDown3_ValueChanged(object sender, System.EventArgs e)
{