Exemplo n.º 1
0
        public void ChangeVaraiblesIndexing()
        {
            string input  = "x0 + 2 * x11 + a2 + xx1 - x-1 + x[1]";
            string result = InputPreprocesor.ReplaceNumberedVaraiblesWithIndexedOnes(input);

            Assert.AreEqual("x[0] + 2 * x[11] + a2 + xx[1] - x-1 + x[1]", result);
        }
Exemplo n.º 2
0
        public void FindDimension()
        {
            string input  = "x[1] + x[2]; 4 + x3;";
            uint   result = InputPreprocesor.FindDimension(input);

            Assert.AreEqual(3u, result);

            input  = InputPreprocesor.ReplaceNumberedVaraiblesWithIndexedOnes(input);
            result = InputPreprocesor.FindDimension(input);
            Assert.AreEqual(4u, result);
        }