Example #1
0
        // Functional Union
        public static GSet <T> /*!*/ Union(GSet <T> /*!*/ a, GSet <T> /*!*/ b)
        {
            Contract.Requires(a != null);
            Contract.Requires(b != null);
            Contract.Ensures(Contract.Result <GSet <T> >() != null);
            //  Contract.Ensures(Contract.ForAll(result, x => a[x] || b[x] ));
            GSet <T> /*!*/ res = (GSet <T> /*!*/)cce.NonNull(a.Clone());

            res.AddRange(b);
            return(res);
        }
Example #2
0
        //----------------------------- Static Methods ---------------------------------

        // Functional Intersect
        public static GSet <T> /*!*/ Intersect(GSet <T> /*!*/ a, GSet <T> /*!*/ b)
        {
            Contract.Requires(b != null);
            Contract.Requires(a != null);
            Contract.Ensures(Contract.Result <GSet <T> >() != null);
            //Contract.Ensures(Contract.ForAll(result, x => a[x] && b[x] ));
            GSet <T> /*!*/ res = (GSet <T> /*!*/)cce.NonNull(a.Clone());

            res.Intersect(b);
            return(res);
        }