예제 #1
0
파일: Set.cs 프로젝트: jfarre20/Ubiquitous
        /// <summary>
        /// Returns intersection of two sets.
        /// </summary>
        /// <remarks>Intersection contains elements present in both sets.</remarks>
        public static Set Intersection(Set a, Set b)
        {
            a.CheckComparer(b);
            Set result = new Set(a.Comparer);

            SetOp.Inersection(a, b, a.Comparer, new Inserter(result));
            return(result);
        }
예제 #2
0
파일: Set.cs 프로젝트: jfarre20/Ubiquitous
        /// <summary>
        /// Returns symmetric difference of two sets.
        /// </summary>
        /// <remarks>
        /// Symmetric difference contains elements present in one of the sets, but not in both
        /// </remarks>
        public static Set SymmetricDifference(Set a, Set b)
        {
            a.CheckComparer(b);
            Set result = new Set(a.Comparer);

            SetOp.SymmetricDifference(a, b, a.Comparer, new Inserter(result));
            return(result);
        }