コード例 #1
0
        public PowerSet <T> Union(PowerSet <T> set2)
        {
            var union = new PowerSet <T>();

            foreach (var val in set2.ToArray())
            {
                union.Put(val);
            }

            foreach (var val in this.ToArray())
            {
                union.Put(val);
            }

            return(union);
        }
コード例 #2
0
        public PowerSet <T> Intersection(PowerSet <T> set2)
        {
            var intersection = new PowerSet <T>();

            foreach (var val in set2.ToArray())
            {
                if (this.Get(val))
                {
                    intersection.Put(val);
                }
            }
            return(intersection);
        }