Not() public method

public Not ( ) : BitArray
return BitArray
 static public int Not(IntPtr l)
 {
     try {
         System.Collections.BitArray self = (System.Collections.BitArray)checkSelf(l);
         var ret = self.Not();
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 private BitArray feistelFunction(BitArray keyBits, BitArray Bittext_16)
 {
     BitArray afterParity = Bittext_16;
     if (checkParity(keyBits)) //true if parity is even
     {
         afterParity = Bittext_16.Not();
         //Console.WriteLine("Right after negating : " + BitOperations.getBinaryString(afterParity));
     }
     //Console.WriteLine("Keybits for xoring : " + BitOperations.getBinaryString(keyBits));
     var feistelOutput = keyBits.Xor(new BitArray(afterParity));
     //Console.WriteLine("right 16 bits after fiestal function : " + BitOperations.getBinaryString(a));
     return feistelOutput;
 }
Esempio n. 3
0
        public void BitArrayToText() {
            var bitArray = new BitArray(32);

            var bitString = bitArray.ToText();
            Assert.AreEqual(32, bitString.Length);
            Assert.IsFalse(bitString.Contains("1"));
            Assert.IsTrue(bitString.All(c => c == '0'));

            bitString = bitArray.Not().ToText();
            Assert.AreEqual(32, bitString.Length);
            Assert.IsFalse(bitString.Contains("0"));
            Assert.IsTrue(bitString.All(c => c == '1'));
        }
Esempio n. 4
0
        public void BitArrayToBytes() {
            var bitArray = new BitArray(32);

            var bytes = bitArray.ToBytes();
            Assert.AreEqual(32 / BitTool.ByteLength, bytes.Length);

            Assert.IsTrue(bytes.All(b => b == 0x00));

            Assert.IsTrue(bytes.GetHexStringFromBytes().All(c => c == '0'));

            bytes = bitArray.Not().ToBytes();
            Assert.IsTrue(bytes.GetHexStringFromBytes().All(c => c == 'F'));

            // Console.WriteLine(bytes.GetHexStringFromBytes());
        }
            public static void BitArray_NotTest()
            {
                // []  Standard cases 

                BitArray ba2 = null;
                BitArray ba4 = null;

                ba2 = new BitArray(6, false);

                ba2.Set(0, true);
                ba2.Set(1, true);

                ba4 = ba2.Not();

                for (int i = 0; i < ba4.Length; i++)
                {
                    if (i <= 1)
                        Assert.False(ba4.Get(i)); //"Err_2! ba4.Get(" + i + ") should be false"
                    else
                        Assert.True(ba4.Get(i)); //"Err_3! ba4.Get(" + i + ") should be true"
                }



                // []  Size stress cases.
                ba2 = new BitArray(0x1000F, false);

                ba2.Set(0, true);
                ba2.Set(1, true);

                ba2.Set(0x10000, true);
                ba2.Set(0x10001, true);

                ba4 = ba2.Not();

                Assert.False(ba4.Get(1)); //"Err_4! ba4.Get(1) should be false"
                Assert.True(ba4.Get(2)); //"Err_5! ba4.Get(2) should be true"

                for (int i = 0x10000; i < ba2.Length; i++)
                {
                    if (i <= 0x10001)
                        Assert.False(ba4.Get(i)); //"Err_6! ba4.Get(" + i + ") should be false"
                    else
                        Assert.True(ba4.Get(i)); //"Err_7! ba4.Get(" + i + ") should be true"
                }
            }
Esempio n. 6
0
        static void BitArrayDemo()
        {
            var bits1 = new BitArray(8);
            bits1.SetAll(true);
            bits1.Set(1, false);
            bits1[5] = false;
            bits1[7] = false;
            Console.Write("initialized: ");
            DisplayBits(bits1);
            Console.WriteLine();

            DisplayBits(bits1);
            bits1.Not();
            Console.Write(" not ");
            DisplayBits(bits1);
            Console.WriteLine();

            var bits2 = new BitArray(bits1);
            bits2[0] = true;
            bits2[1] = false;
            bits2[4] = true;
            DisplayBits(bits1);
            Console.Write(" or ");
            DisplayBits(bits2);
            Console.Write(" : ");
            bits1.Or(bits2);
            DisplayBits(bits1);
            Console.WriteLine();

            DisplayBits(bits2);
            Console.Write(" and ");
            DisplayBits(bits1);
            Console.Write(" : ");
            bits2.And(bits1);
            DisplayBits(bits2);
            Console.WriteLine();

            DisplayBits(bits1);
            Console.Write(" xor ");
            DisplayBits(bits2);
            bits1.Xor(bits2);
            Console.Write(" : ");
            DisplayBits(bits1);
            Console.WriteLine();
        }
Esempio n. 7
0
 /// <summary>
 /// Takes bits array of positive number and make this number negative.
 /// First invert input bit array, then adds 1. That makes positive number negative.
 /// </summary>
 /// <param name="arr">Bit array of positive number</param>
 private void Negative(BitArray arr)
 {
     arr.Not();
     bool overflow = false;
     for (int i = 0; i < arr.Length; i++)
         if (i == 0)
         {
             if (arr[0] & true) overflow = true;
             arr[0] ^= true;
         }
         else if (overflow)
         {
             if (!(arr[i] & true))
                 overflow = false;
             arr[i] ^= true;
         }
         else break;
 }
Esempio n. 8
0
            public BitArray/*!*/ Parse() {
                _pos = 0;

                BitArray result = new BitArray(256);
                if (_range.Length == 0) {
                    return result;
                }

                bool negate = false;
                if (_range.GetChar(0) == '^') {
                    // Special case of ^
                    if (_range.Length == 1) {
                        result.Set('^', true);
                        return result;
                    }

                    negate = true;
                    _pos = 1;
                    result.Not();
                }

                int c;
                while ((c = NextToken()) != -1) {
                    if (_rangeStarted) {
                        // _startRange - c. ignore ranges which are the reverse sequence
                        if (_startRange <= c) {
                            for (int i = _startRange; i <= c; ++i)
                                result.Set(i, !negate);
                        }
                        _rangeStarted = false;
                    } else {
                        int p = PeekChar();
                        if (p == '-') {
                            // z- is treated as a literal 'z', '-'
                            if (_pos == _range.Length - 1) {
                                result.Set(c, !negate);
                                result.Set('-', !negate);
                                break;
                            }

                            _startRange = c;
                            if (_rangeStarted) {
                                result.Set('-', !negate);
                                _rangeStarted = false;
                            } else {
                                _rangeStarted = true;
                            }
                            _pos++; // consume -
                        } else {
                            result.Set(c, !negate);
                        }
                    }
                }

                return result;
            }
 public void Minus(HasseFingerprint FP)
 {
     // do this AND (NOT that)
     BitArray fpx= new BitArray (FP.fp);
     fpx.Not ();
     fp.And(fpx);
     this.bitCount = this.CountBits();
 }
Esempio n. 10
0
            // TODO: refactor this and Parse()
            public MutableString/*!*/ ParseSequence() {
                _pos = 0;

                MutableString result = MutableString.CreateBinary();
                if (_range.Length == 0) {
                    return result;
                }

                bool negate = false;
                if (_range.GetChar(0) == '^') {
                    // Special case of ^
                    if (_range.Length == 1) {
                        result.Append('^');
                        return result;
                    }

                    negate = true;
                    _pos = 1;
                }

                BitArray array = new BitArray(256);
                array.Not();

                int c;
                while ((c = NextToken()) != -1) {
                    if (_rangeStarted) {
                        // _startRange - c. ignore ranges which are the reverse sequence
                        if (_startRange <= c) {
                            for (int i = _startRange; i <= c; ++i) {
                                if (negate) {
                                    array.Set(i, false);
                                } else {
                                    result.Append((byte)i);
                                }
                            }
                        }
                        _rangeStarted = false;
                    } else {
                        int p = PeekChar();
                        if (p == '-') {
                            // z- is treated as a literal 'z', '-'
                            if (_pos == _range.Length - 1) {
                                if (negate) {
                                    array.Set(c, false);
                                    array.Set('-', false);
                                } else {
                                    result.Append((byte)c);
                                    result.Append('-');
                                }
                                break;
                            }

                            _startRange = c;
                            if (_rangeStarted) {
                                if (negate) {
                                    array.Set('-', false);
                                } else {
                                    result.Append('-');
                                }
                                _rangeStarted = false;
                            } else {
                                _rangeStarted = true;
                            }
                            _pos++; // consume -
                        } else {
                            if (negate) {
                                array.Set(c, false);
                            } else {
                                result.Append((byte)c);
                            }
                        }
                    }
                }

                if (negate) {
                    for (int i = 0; i < 256; i++) {
                        if (array.Get(i)) {
                            result.Append((byte)i);
                        }
                    }
                }
                return result;
            }
Esempio n. 11
0
            /// <summary>
            /// Add a transition from NState "this"
            /// to NState "nxt", for each character
            /// value in the leaf range list.
            /// If the characters are packed, transform 
            /// from character ordinal to equivalence class 
            /// ordinal.
            /// </summary>
            /// <param name="leaf">The regex leaf node</param>
            /// <param name="nxt">The destination state</param>
            public void AddClsTrans(Leaf leaf, NState nxt)
            {
                if (myNfaInst.parent.task.CaseAgnostic) {
                    leaf.rangeLit.list = leaf.rangeLit.list.MakeCaseAgnosticList();
                    leaf.rangeLit.list.Canonicalize();
                }

                BitArray cls = new BitArray(myNfaInst.MaxSym);
                if (myNfaInst.Pack)
                {
                    foreach (int ord in leaf.rangeLit.equivClasses)
                        cls[ord] = true;
                }
                else
                {
                    foreach (CharRange rng in leaf.rangeLit.list.Ranges)
                        for (int i = rng.minChr; i <= rng.maxChr; i++)
                            cls[i] = true;
                    if (leaf.rangeLit.list.IsInverted)
                        cls = cls.Not();
                }
                AddClsTrans(cls, nxt);
            }
Esempio n. 12
0
 /// <summary>
 /// Add a transition from NState "this"
 /// to NState "nxt", for each character
 /// value in the leaf range list.
 /// If the characters are packed, transform 
 /// from character ordinal to equivalence class 
 /// ordinal.
 /// </summary>
 /// <param name="leaf">The regex leaf node</param>
 /// <param name="nxt">The destination state</param>
 public void AddClsTrans(Leaf leaf, NState nxt)
 {
     BitArray cls = new BitArray(myNfaInst.MaxSym);
     if (myNfaInst.Pack)
     {
         foreach (int ord in leaf.rangeLit.equivClasses)
             cls[ord] = true;
     }
     else
     {
         foreach (CharRange rng in leaf.rangeLit.list.Ranges)
             for (int i = rng.minChr; i <= rng.maxChr; i++)
                 cls[i] = true;
         if (leaf.rangeLit.list.IsInverted)
             cls = cls.Not();
     }
     AddClsTrans(cls, nxt);
 }
Esempio n. 13
0
 public static BitArray AndNot(BitArray b1, BitArray b2)
 {
     if (b1.Length > b2.Length)
     {
         b2.Length = b1.Length;
     }
     else if (b2.Length > b1.Length)
     {
         b1.Length = b2.Length;
     }
     b1.And(b2.Not());
     return b1;
 }
        /// <summary>
        /// Gets one's complement of a signed integer
        /// </summary>
        /// <param name="number">signed integer (value) </param>
        /// <param name="index">number of bits in the signed int</param>
        /// <returns>one's complement of a signed int</returns>
        internal static int OnesComplement(int number, int bits)
        {
            // zero count offset
            bits--;

            // convert to bit array.
            BitArray compArray = new BitArray(BitConverter.GetBytes(number));

            // a true most significant bit (MSB) indicates a negative 
            // nubmer and all bits must be flipped (~).
            if (compArray.Get(bits))
            {
                // invert all bits (complement)
                compArray.Not();

                // set all unused bits to false.
                for (int i = bits; i < compArray.Length; i++)
                {
                    compArray[i] = false;
                }

                // convert bitarray to integer, using copyto.
                int[] retunArray = new int[1];
                compArray.CopyTo(retunArray, 0);

                // return negative complement
                return -(retunArray[0]);
            }

            // positive complement = binary representation
            return number;
        }
Esempio n. 15
0
        public static void Main()
        {
            Cons.WriteLine($"Chapter 10 - Collections...");

            //Play._Time(1);
            //Play._Time(2);

            //Collection Initializers
            var intList = new List <int>()
            {
                1, 2, 3, 4, 5
            };

            //Racers
            Racer GHill = new Racer(2, "Graham", "Hill", "UK", 10);
            Racer DHill = new Racer(7, "Dameon", "Hill", "UK", 14);

            var racers = new List <Racer>(10)
            {
                GHill, DHill
            };

            Cons.WriteLine($"{racers.Count} racers so far.");

            racers.Add(new Racer(24, "Michael", "Schumacher", "Germany", 91));
            racers.Insert(0, new Racer(22, "Ayrton", "Senna", "Brazil", 41));

            //Accessing elements
            var a1 = racers[0];

            Cons.WriteLine("Print list with a foreach loop.........................................");
            foreach (var r in racers)
            {
                Cons.WriteLine(r.ToString("N", null));
            }

            //Delagates again!
            Cons.WriteLine("Now using a delegate.........................................");
            racers.ForEach(Cons.WriteLine);
            Cons.WriteLine("Now using lambda to format.........................................");
            racers.ForEach(r => Cons.WriteLine($"{r:w}"));

            Racer R1 = new Racer(22, "Ayrton", "Senna", "Brazil", 41);

            if (!racers.Remove(R1))
            {
                Cons.WriteLine($"Racer {R1.Id} not found to remove.");
            }

            R1 = DHill;
            if (!racers.Remove(R1))
            {
                Cons.WriteLine($"Racer {DHill.Id} not found to remove.");
            }

            racers.Add(R1);
            //Using Find Predicate
            //int i2 = racers.FindIndex(new FindCountry("Finland").FindCountryPredicate);   This works but has a bugget, not my code!
            int i3 = racers.FindIndex(r => r.Country == "UK"); //Sane as line above and more likely to be used...

            i3 = racers.FindLastIndex(r => r.Country == "UK"); //Sane as line above and more likely to be used...

            var R2       = racers.FindLast(r => r.LastName == "Louder");
            var someWins = racers.FindAll(r => r.Wins < 20);

            someWins.Sort();

            var bigWiners = racers.FindAll(r => r.Wins > 20);

            bigWiners.Sort();

            racers.Sort(new RacerComp(RacerComp.CompareType.LastName));

            racers.Sort(new RacerComp(RacerComp.CompareType.Country));

            //Sort using delagte and Lambda expression.
            racers.Sort((r1, r2) => r2.Wins.CompareTo(r1.Wins));
            racers.Reverse();

            //Type Conversion...
            var rPeople = racers.ConvertAll <Person>(r => new Person(r.FirstName + ',' + r.LastName));

            //Read-Only Collections
            var roRacers = racers.AsReadOnly();

            //Queues
            var dm = new DocsManager();

            ProcessDocs.Start(dm);
            //Create docs and add too dm
            for (int i = 0; i < 100; i++)
            {
                var doc = new Doc("Doc" + i.ToString(), "AID" + new Random().Next(20).ToString());
                dm.AddDoc(doc);
                Console.WriteLine($"Added Document: {doc.Title} by {doc.Auther} to queue.");
                Thread.Sleep(new Random().Next(20));
            }

            Thread.Sleep(2000);
            ProcessDocs.Stop();

            //Stacks Quick one...
            var lets = new Stack <char>();

            lets.Push('A');
            lets.Push('B');
            lets.Push('C');

            foreach (var l in lets)
            {
                Cons.Write(l);
            }
            Cons.WriteLine();

            while (lets.Count > 0)
            {
                Cons.Write(lets.Pop());
            }
            Cons.WriteLine($"Next...");

            //Linked Lists...
            var pDM = new PDocManager();

            pDM.AddPDoc(new PDoc("Adoc", "AAAdams", 4));
            pDM.AddPDoc(new PDoc("Bdoc", "BBabs", 8));
            pDM.AddPDoc(new PDoc("Cdoc", "CCock", 4));
            pDM.AddPDoc(new PDoc("Ddoc", "AAAdams", 8));
            pDM.AddPDoc(new PDoc("Edoc", "CCock", 8));

            pDM.DisplayAllNodes();

            //Simple Sorted List
            var boots = new SortedList <int, string>();

            boots.Add(18, "Knee High");
            boots.Add(27, "Thigh Length");
            boots[12] = "Calfe";
            boots[6]  = "Ankle";

            foreach (var b in boots)
            {
                Cons.WriteLine($"{b.Key}, {b.Value}");
            }

            boots[27] = "Thigh High";

            foreach (var b in boots)
            {
                Cons.WriteLine($"{b.Key}, {b.Value}");
            }

            //What Next....for DCoates
            var employees = new Dictionary <EmployeeId, DicEmployee>();

            var idCat = new EmployeeId("A000001");
            var eCat  = new DicEmployee(idCat, "Cat", 100000.00m);

            employees.Add(idCat, eCat);

            var idAnt = new EmployeeId("A012345");
            var eAnt  = new DicEmployee(idAnt, "Ant", 23000.00m);

            employees.Add(idAnt, eAnt);

            var idBee = new EmployeeId("B000001");
            var eBee  = new DicEmployee(idBee, "Bee", 40000.00m);

            employees.Add(idBee, eBee);

            var idDog = new EmployeeId("A000002");
            var eDog  = new DicEmployee(idDog, "Dog", 10000.00m);

            employees.Add(idDog, eDog);

            foreach (var e in employees)
            {
                Cons.WriteLine(e.ToString());
            }

            while (true)
            {
                Cons.Write("Enter am Empolyee Id: (X to exit)>");
                var uIn = Cons.ReadLine();
                if (uIn.ToLower() == "x")
                {
                    break;
                }

                EmployeeId eId;
                try
                {
                    eId = new EmployeeId(uIn);

                    DicEmployee dEmp;
                    if (!employees.TryGetValue(eId, out dEmp))
                    {
                        Cons.WriteLine($"Employee with {eId} does not exist.");
                    }
                    else
                    {
                        Cons.WriteLine(dEmp);
                    }
                }
                catch (EmployeeIdException ee)
                {
                    Cons.WriteLine(ee.Message);
                }
            }

            //Lookups from System.core
            //Use the racers list from above

            var lookupRacers = racers.ToLookup(r => r.Country);

            foreach (var r in lookupRacers["UK"])
            {
                Cons.WriteLine($"name:{r.LastName}, {r.FirstName}");
            }
            //Nice but not sorted!

            //Sorted Dics....
            //Simple Sorted List
            var sdBoots = new SortedDictionary <int, string> {
                { 18, "Knee High" }, { 27, "Thigh Length" }
            };

            sdBoots[12] = "Calfe";
            sdBoots[6]  = "Ankle";

            foreach (var b in sdBoots)
            {
                Cons.WriteLine($"{b.Key}, {b.Value}");
            }

            //Sets...
            var allTeams = new HashSet <string>()
            {
                "Ferrari", "Lotus", "McLaren", "Honda", "BRM", "Aston Martin", "Red Bull", "Force India", "Sauber", "Williams"
            };
            var coTeams = new HashSet <string>()
            {
                "Ferrari", "Lotus", "McLaren", "Honda"
            };
            var oldTeams = new HashSet <string>()
            {
                "Ferrari", "Lotus", "BRM", "Aston Martin"
            };
            var newTeams = new HashSet <string>()
            {
                "Red Bull", "Force India", "Sauber"
            };

            var res = coTeams.Add("Williams");

            res = coTeams.Add("Williams");

            res = coTeams.IsSubsetOf(allTeams);
            res = allTeams.IsSupersetOf(coTeams);
            res = oldTeams.Overlaps(coTeams);
            res = newTeams.Overlaps(coTeams);

            var allTeams2 = new SortedSet <string>(coTeams);

            allTeams2.UnionWith(oldTeams);
            allTeams2.UnionWith(newTeams);

            res = allTeams2.SetEquals(allTeams);

            var tTeams = new SortedSet <string>(allTeams);

            tTeams.SymmetricExceptWith(oldTeams);
            var yTeams = new SortedSet <string>(allTeams);
            var yI     = new SortedSet <string>(yTeams.Intersect(oldTeams));

            //Observable Collections
            Cons.Clear();
            Cons.WriteLine("Observable Collections....");
            var data = new ObservableCollection <string>();

            data.CollectionChanged += Data_CollectionChanged;
            data.Add("First");
            data.Add("Second");
            data.Insert(1, "Three");
            data.Remove("Three");

            //Bits and bobs....
            Cons.WriteLine("Bits and Bobs....");
            var bitsA = new Col.BitArray(8);

            bitsA.SetAll(true);
            bitsA.Set(1, false);
            DisplayBits(bitsA);

            Cons.WriteLine();
            bitsA.Not();
            DisplayBits(bitsA);

            byte[] aI    = { 22 };
            var    bitsB = new Col.BitArray(aI);

            DisplayBits(bitsB);

            bitsA.Or(bitsB);
            DisplayBits(bitsA);

            //BitVector32 Struct
            var vBits = new Col.Specialized.BitVector32();
            int m1    = BitVector32.CreateMask();
            int m2    = BitVector32.CreateMask(m1);
            int m3    = BitVector32.CreateMask(m2);
            int m4    = BitVector32.CreateMask(m3);
            int m5    = BitVector32.CreateMask(128);

            vBits[m1] = true;
            vBits[m3] = true;
            vBits[m4] = true;
            vBits[m5] = true;

            Cons.WriteLine(vBits);

            int rec      = 0x88abcde;
            var vBitRSet = new BitVector32(rec);

            Cons.WriteLine(vBitRSet);

            //Immutable Collections
            ImmutabeThings.ImmutableTing1();

            Cons.ReadKey();
        }
Esempio n. 16
0
        public Genome MakeChild(Genome other, BitArray mask)
        {
            BitArray leftCopy = new BitArray(this.genome);
            BitArray rightCopy = new BitArray(other.genome);
            BitArray maskCopy = new BitArray(mask);

            leftCopy.And(maskCopy);
            rightCopy.And(maskCopy.Not());

            //BitArray temp2 = new BitArray(right.And(mask.Not()));
            return new Genome(leftCopy.Or(rightCopy));
        }
Esempio n. 17
0
        static void Main(string[] args)
        {
            // Creates an initializes several BitArrays.
            BitArray myBA1 = new BitArray(5);

            BitArray myBA2 = new BitArray(5, false);

            byte[] myBytes = new byte[5] { 1, 2, 3, 4, 5 };
            BitArray myBA3 = new BitArray(myBytes);

            bool[] myBools = new bool[5] { true, false, true, true, false };
            BitArray myBA4 = new BitArray(myBools);

            int[] myInts = new int[5] { 6, 7, 8, 9, 10 };
            BitArray myBA5 = new BitArray(myInts);

            // Displays the properties and values of the BitArrays.
            Console.WriteLine("myBA1");
            Console.WriteLine("   Count:    {0}", myBA1.Count);
            Console.WriteLine("   Length:   {0}", myBA1.Length);
            Console.WriteLine("   Values:");
            PrintValues(myBA1, 8);

            Console.WriteLine("myBA2");
            Console.WriteLine("   Count:    {0}", myBA2.Count);
            Console.WriteLine("   Length:   {0}", myBA2.Length);
            Console.WriteLine("   Values:");
            PrintValues(myBA2, 8);

            Console.WriteLine("myBA3");
            Console.WriteLine("   Count:    {0}", myBA3.Count);
            Console.WriteLine("   Length:   {0}", myBA3.Length);
            Console.WriteLine("   Values:");
            PrintValues(myBA3, 8);

            Console.WriteLine("myBA4");
            Console.WriteLine("   Count:    {0}", myBA4.Count);
            Console.WriteLine("   Length:   {0}", myBA4.Length);
            Console.WriteLine("   Values:");
            PrintValues(myBA4, 8);

            Console.WriteLine("myBA5");
            Console.WriteLine("   Count:    {0}", myBA5.Count);
            Console.WriteLine("   Length:   {0}", myBA5.Length);
            Console.WriteLine("   Values:");
            PrintValues(myBA5, 8);

            int[] myAntiInts = new int[5] { -1, -1, -1, -1, -1 };
            BitArray myBA6 = new BitArray(myAntiInts);
            Console.WriteLine("myBA6");
            Console.WriteLine("   Count:    {0}", myBA5.Count);
            Console.WriteLine("   Length:   {0}", myBA5.Length);
            Console.WriteLine("   Values:");
            PrintValues(myBA6, 8);

            Console.WriteLine("\nXORing BA5 with BA6...\n");
            BitArray myBA7 = myBA5.Xor(myBA6);
            Console.WriteLine("myBA7");
            Console.WriteLine("   Count:    {0}", myBA5.Count);
            Console.WriteLine("   Length:   {0}", myBA5.Length);
            Console.WriteLine("   Values:");
            PrintValues(myBA7, 8);

            Console.WriteLine("myBA5");
            Console.WriteLine("   Count:    {0}", myBA5.Count);
            Console.WriteLine("   Length:   {0}", myBA5.Length);
            Console.WriteLine("   Values:");
            PrintValues(myBA5, 8);

            Console.WriteLine("myBA6");
            Console.WriteLine("   Count:    {0}", myBA5.Count);
            Console.WriteLine("   Length:   {0}", myBA5.Length);
            Console.WriteLine("   Values:");
            PrintValues(myBA6, 8);

            Console.WriteLine("\nNot on myBA5:\n");
            myBA5.Not();
            Console.WriteLine("myBA5");
            Console.WriteLine("   Count:    {0}", myBA5.Count);
            Console.WriteLine("   Length:   {0}", myBA5.Length);
            Console.WriteLine("   Values:");
            PrintValues(myBA5, 8);
        }