Exemple #1
0
        private void DifferenceScan(ListFast <T> listFastReference, out ListFast <T> listFastBaseDifference, out ListFast <T> listFastReferenceDifference)
        {
            listFastBaseDifference = new ListFast <T>()
            {
                Unique = true
            };
            listFastReferenceDifference = new ListFast <T>()
            {
                Unique = true
            };
            int count = this.Count;

            //Base to Reference
            for (int i = 0; i < count; i++)
            {
                T value = this._items[i];
                if (!listFastReference.Contains(value))
                {
                    listFastBaseDifference.Add(value);
                }
            }
            //Reference to Base
            count = listFastReference.Count;
            for (int i = 0; i < count; i++)
            {
                T value = listFastReference._items[i];
                if (!listFastReferenceDifference.Contains(value))
                {
                    listFastReferenceDifference.Add(value);
                }
            }
        }
Exemple #2
0
 public ListFast(ListFast <T> list)
 {
     this.MinSizeSearchSeek       = list.MinSizeSearchSeek;
     this.MinSizeSearchStartSeek  = list.MinSizeSearchStartSeek;
     this.StepSizeSearchStartSeek = list.StepSizeSearchStartSeek;
     this.IsAddSorted             = list.IsAddSorted;
     this.Unique = list.Unique;
     this._items.AddRange(list._items);
 }
Exemple #3
0
 public bool Difference(ListFast <T> listFastReference, out ListFast <T> listFastBaseDifference, out ListFast <T> listFastReferenceDifference)
 {
     //Seek
     //if ((this._isSorted) && (listFastReference._isSorted))
     //    this.DifferenceSeek(listFastReference, out listFastBaseDifference, out listFastReferenceDifference);
     //else //Scan
     this.DifferenceScan(listFastReference, out listFastBaseDifference, out listFastReferenceDifference);
     return((listFastBaseDifference.Count > 0) || (listFastReferenceDifference.Count > 0));
 }
Exemple #4
0
 public void Replace(ListFast <T> listFast)
 {
     this._items = listFast._items;
     if ((this._isSorted) && (!listFast._isSorted))
     {
         this._isSorted = false;
     }
     this.EnsureSort();
 }
Exemple #5
0
 private bool IsEqualScan(ListFast <T> list)
 {
     for (int i = 0; i < this.Count; i++)
     {
         if (!list.Contains(this[i]))
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #6
0
 private bool IsEqualSeek(ListFast <T> list)
 {
     for (int i = 0; i < this.Count; i++)
     {
         if (Compare(this[i], list[i]) != 0)
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #7
0
        public ListFast <int> Intersection(ListFast <int> list1, ListFast <int> list2)
        {
            ListFast <int> list = new ListFast <int>();

            for (int i = list1.Count; i >= 0; i--)
            {
                int value = list1[i];
                if (list2.Contains(value))
                {
                    list.Add(value);
                }
            }
            return(list);
        }
Exemple #8
0
 public bool IsEqual(ListFast <T> list)
 {
     if (this.Count != list.Count)
     {
         return(false);
     }
     //Seek
     if ((this._isSorted) && (list._isSorted))
     {
         return(IsEqualSeek(list));
     }
     //Scan
     return(IsEqualScan(list));
 }
Exemple #9
0
 private void DifferenceSeek(ListFast <T> listReference, out ListFast <T> listFastBaseDifference, out ListFast <T> listFastReferenceDifference)
 {
     //TODO: Work over here
     listFastBaseDifference = new ListFast <T>()
     {
         Unique = true
     };
     listFastReferenceDifference = new ListFast <T>()
     {
         Unique = true
     };
     if (this.Count < listReference.Count)
     {
         int count = this.Count;
         for (int i = 0; i < count; i++)
         {
         }
     }
     else
     {
     }
 }