public IBitset And(IBitset otherSet) { IBitset result = this.Clone(); result.AndWith(otherSet); return(result); }
public virtual void AndWithTest() { int[] first = SetGenerator.GetRandomArray(TEST_SET_LENGTH); int[] second = SetGenerator.GetRandomArray(TEST_SET_LENGTH); int[] result = first.Intersect(second).ToArray(); IBitset testSet = CreateSetFromIndices(first, TEST_SET_LENGTH); testSet.AndWith(CreateSetFromIndices(second, TEST_SET_LENGTH)); Assert.AreEqual(CreateSetFromIndices(result, TEST_SET_LENGTH), testSet); }