예제 #1
0
파일: Poly.cs 프로젝트: sortutay/diploma
        public Poly Multiply(Poly p)
        {
            Poly result = new Poly();

            for (int i = 0; i < units.Count; i++)
            {
                for (int j = 0; j < p.units.Count; j++)
                {
                    result.Add(units[i].Multiply(p.units[j]));
                }
            }

            return(result);
        }
예제 #2
0
        public Poly Parse(string line)
        {
            var listOfStringTerms = ParseToStringTerms(line);

            var poly = new Poly();

            foreach (var stringTerm in listOfStringTerms)
            {
                var parsedTerm = ParseTerm(stringTerm);

                if (parsedTerm != null)
                {
                    poly.Add(parsedTerm);
                }
            }

            return(poly);
        }