public Varset And(Varset varset) { Varset cp = new Varset(this); cp.AlignLength(varset); cp.item.And(varset.item); return cp; }
public Varset Add(Varset varset) { Varset cp = new Varset(this); Varset zero = new Varset(0); cp.AlignLength(varset); while (!varset.Equals(zero)) { Varset tmp = cp.And(varset).LeftShift(1); cp = cp.Xor(varset); varset = tmp; } return cp; }
public bool LessThan(Varset varset) { Varset cp = new Varset(this); Varset cp2 = new Varset(varset); cp.AlignLength(cp2); for (int i = cp.item.Length - 1; i >= 0; i--) { if (cp.item[i] && !cp2.item[i]) { return false; } else if (!cp.item[i] && cp2.item[i]) { return true; } } return false; }
public bool Equals(Varset varset) { Varset cp = new Varset(this); Varset cp2 = new Varset(varset); cp.AlignLength(cp2); for (int i = 0; i < cp.item.Length; i++) { if (cp.item[i] != cp2.item[i]) { return false; } } return true; }