private void Norris() { L = new List <concept>(); for (int i = 0; i < cont.uRow.uni; i++) { concept x = new concept(cont[i], i); x.Intens.univers = cont.uRow; x.Extens.univers = cont.uColumn; if (L.Count != 0) { for (int j = 0; j < L.Count; j++) { if (L[j] <= x) { concept c = new concept(L[j].Extens, L[j].Intens + x.Intens); L[j] = c; } else { smallSet z = L[j].Extens * x.Extens; if (relCanon(i, L[j].Intens, z)) { concept c = new concept(z, L[j].Intens + x.Intens); L.Add(c); } } } } if (canon(i)) { L.Add(x); } } }
public smallSet makeSmallSet(int c) { smallSet a = new smallSet(); for (int i = 0; i < body.Count; i++) { a[i] = body[i][c]; } a.univers = uR; return(a); }
private bool relCanon(int ind, smallSet Y, smallSet z) { for (int i = 0; i < ind; i++) { if (!Y[i] && (z * cont[i]) == z) { return(false); } } return(true); }
public context(System.Windows.Forms.DataGridView d) { body = new List <smallSet>(); int r = d.RowCount; int c = d.ColumnCount; //body = new smallSet[r]; for (int i = 0; i < d.RowCount; i++) { smallSet s = new smallSet(d, i); body.Add(s); body[i].univers = uR; } }
private int checkExstens(smallSet s, List <concept> L)//сравнивать признаки с признаками, сейчас объекты с признаками { for (int i = 0; i < L.Count; i++) { if (L[i].Extens.Count == 0) { i++; } if (L[i].Extens <= s) { return(1); } } return(0); }
private void button2_Click(object sender, EventArgs e) { u = new universum(dataGridView4); s1 = new smallSet(dataGridView1); s1.univers = u; s2 = new smallSet(dataGridView2); s2.univers = u; dataGridView4.Enabled = false; dataGridView1.Enabled = false; dataGridView2.Enabled = false; string s = s1.ToString(); textBox2.Text = s1.ToString(); textBox3.Text = s2.ToString(); textBox1.Hide(); button1.Hide(); }
public smallSet complement() { smallSet r = new smallSet(); r.univers = this.univers; for (int i = 0; i < this.universN; i++) { if (this[i]) { r[i] = false; } else { r[i] = true; } } return(r); }
public static smallSet operator -(smallSet a, smallSet b) { smallSet r = new smallSet(); r.univers = a.univers; for (int i = 0; i < a.universN; i++) { if (a[i] == true && b[i] == false) { r[i] = true; } else { r[i] = false; } } return(r); }
private void button5_Click(object sender, EventArgs e) { smallSet a = cont.makeSmallSet(Convert.ToInt32(this.textBox5.Text)); dataGridView7.Columns.Clear(); dataGridView7.Rows.Clear(); for (int i = 0; i < a.univers.uni; i++) { dataGridView7.Columns.Add(Convert.ToString(i), Convert.ToString(i)); } dataGridView7.Rows.Add(); a.toDGV(dataGridView7); dataGridView7.Refresh(); //�מננטס textBox6.Text = a.ToString(); Norris(); toListBox(L); norrisL.Refresh(); }
public concept(smallSet r, int n) { Intens = new smallSet(n); Extens = r; }
public concept(smallSet r, smallSet n) { Intens = n; Extens = r; }
public void Add(smallSet s, string str) { body.Add(s); uR.Add(str); }
public void Delete(smallSet s, int ind) { body.Remove(s); uR.Delete(ind); }