Esempio n. 1
0
        public void Test4()
        {
            var polynomials = new List <Polynomial> {
                new Polynomial(new List <RationalNumber> {
                    0, 0, 1
                }, XName)
            };
            var saturatedSystem = SimpleSaturator.Saturate(polynomials).ToList();

            var expected = new List <Polynomial>
            {
                new Polynomial(new List <RationalNumber> {
                    0
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    2
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    0, 2
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    0, 0, 1
                }, XName),
            };

            CollectionAssert.AreEquivalent(expected, saturatedSystem);
        }
Esempio n. 2
0
        public void Test3()
        {
            var polynomials = new List <Polynomial> {
                new Polynomial(new List <RationalNumber> {
                    1, 1, 0, 1
                }, XName)
            };
            var saturatedSystem = SimpleSaturator.Saturate(polynomials).ToList();

            var expected = new List <Polynomial>
            {
                new Polynomial(new List <RationalNumber> {
                    -9
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    new RationalNumber(-31, 8)
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    new RationalNumber(2, 3)
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    1
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    6
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    new RationalNumber(31, 4)
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    1, new RationalNumber(2, 3)
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    0, 6
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    1, 0, 3
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    1, 1, 0, 1
                }, XName)
            };

            foreach (var p in expected)
            {
                if (saturatedSystem.Contains(p))
                {
                    continue;
                }
                throw new Exception();
            }

            CollectionAssert.AreEquivalent(expected, saturatedSystem);
        }
Esempio n. 3
0
        public void Test1()
        {
            var polynomials = new List <Polynomial> {
                new Polynomial(new List <RationalNumber> {
                    0
                }, XName)
            };
            var saturatedSystem = SimpleSaturator.Saturate(polynomials).ToList();

            CollectionAssert.AreEquivalent(polynomials, saturatedSystem);
        }
Esempio n. 4
0
        public void Test5()
        {
            var polynomials = new List <Polynomial> {
                new Polynomial(new List <RationalNumber> {
                    1, -1, -1, 1
                }, XName)
            };
            var saturatedSystem = SimpleSaturator.Saturate(polynomials).ToList();

            var expected = new List <Polynomial>
            {
                new Polynomial(new List <RationalNumber> {
                    0
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    new RationalNumber(16, 27)
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    4
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    new RationalNumber(-4, 3)
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    new RationalNumber(-8, 9)
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    new RationalNumber(8, 9), new RationalNumber(-8, 9)
                },
                               XName),
                new Polynomial(new List <RationalNumber> {
                    6
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    -2, 6
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    -1, -2, 3
                }, XName),
                new Polynomial(new List <RationalNumber> {
                    1, -1, -1, 1
                }, XName)
            };

            CollectionAssert.AreEquivalent(expected, saturatedSystem);
        }
Esempio n. 5
0
        public void Test5()
        {
            var polynomials = new List <Polynomial> {
                new Polynomial(new List <RationalNumber> {
                    0
                }, XName)
            };
            var saturatedSystem = SimpleSaturator.Saturate(polynomials).ToList();
            var table           = new SimpleTarskiTable(saturatedSystem);
            var signs           = table[polynomials[0]].ToList();

            var expected = new List <Sign> {
                Sign.Zero, Sign.Zero
            };

            CollectionAssert.AreEquivalent(expected, signs);
        }