Пример #1
0
 public HtmlBuilder(SimplexField _matrix)
 {
     this.table = new Table();
     this.table.BorderStyle = BorderStyle.Solid;
     this.table.BorderWidth = 1;
     this.table.GridLines = GridLines.Both;
     this.field = _matrix;
 }
Пример #2
0
 public void Build(SimplexField _matrix)
 {
     throw new NotImplementedException();
 }
Пример #3
0
 /// <summary>
 /// Konstruktor
 /// Initialisiert die interne Membervariable field
 /// </summary>
 /// <param name="field">Feld auf das der Simplex angewendet werden soll</param>
 public Simplex(SimplexField field)
 {
     this.Field = field;
 }
    private void ShowView()
    {
        string state = Session["state"] as string;
        Simplex simplex;
        switch (state)
        {
            case "phase3nextstep":
                this.field = (SimplexField) Session["field"];

                simplex = new Simplex(this.field);
                simplex.NextStep();
                this.field = simplex.Field;

                this.DrawField();
                this.MultiView1.SetActiveView(this.View3);
                Session["field"] = this.field;
                if (simplex.isComplete())
                {
                    this.nextButton.Enabled = false;
                }

                break;
            case "phase3refresh":
                this.field = (SimplexField) Session["field"];
                this.DrawField();
                this.MultiView1.SetActiveView(this.View3);
                break;
            case "phase3":
                this.GenerateField();
                simplex = new Simplex(this.field);
                simplex.SetPivotElement();
                this.field = simplex.Field;
                this.DrawField();
                this.MultiView1.SetActiveView(this.View3);
                break;
            case "phase2":
                this.MultiView1.SetActiveView(this.View2);
                break;
            case "start":
            case null:
            default:
                Application["state"] = "start";
                this.MultiView1.SetActiveView(this.View1);
                break;
        }
    }
    private void GenerateField()
    {
        int columns = this.VarTextBoxes.GetLength(0);

        this.field = new SimplexField(columns);

        Row[] rows = new Row[this.VarTextBoxes.GetLength(1)];

        for (int y = 0; y < this.VarTextBoxes.GetLength(1); y++)
        {
            double[] drow = new double[this.VarTextBoxes.GetLength(0)];

            for (int x = 0; x < this.VarTextBoxes.GetLength(0); x++)
            {
                if (this.VarTextBoxes[x, y] == null)
                {
                    drow[x] = 0;
                }
                else
                {
                    try
                    {
                        drow[x] = Convert.ToDouble(this.VarTextBoxes[x, y].Text);
                    }
                    catch
                    {
                        drow[x] = 0;
                    }
                }
            }
            rows[y] = new Row(drow);
        }

        foreach (Row row in rows)
        {
            this.field.AddRow(row);
        }

        Session["field"] = this.field;
    }
    private void DrawField()
    {
        HtmlBuilder htmlBuilder;

        if (Session["field"] == null)
            Session.Add("field", this.field);

        this.field = (SimplexField) Session["field"];

        //this.field.PivotColumn = Convert.ToInt32(this.PivotColumn.Text);
        //this.field.PivotRow = Convert.ToInt32(this.PivotRow.Text);

        htmlBuilder = new HtmlBuilder(this.field);
        htmlBuilder.ShowColumnHeader = true;
        htmlBuilder.ShowRowHeader = true;
        htmlBuilder.ForeColor = Color.Orange;
        Table table = htmlBuilder.GetTable();

        this.Panel1.Controls.Add(table);

        Session["field"] = this.field;
    }