Esempio n. 1
0
        public static Polynome operator -(Polynome p, double arg)
        {
            var result = new Polynome(p);

            result.polynomeList.AddLast(-arg);
            return(result);
        }
Esempio n. 2
0
        public static Polynome operator *(Polynome p1, Polynome p2)
        {
            var result = new Polynome(p1);

            foreach (var monome in p2)
            {
                result *= monome;
            }
            return(result);
        }
Esempio n. 3
0
        public static Polynome operator *(Polynome p, double arg)
        {
            var result  = new Polynome(p);
            var current = result.polynomeList.First;

            while (current.Next != null)
            {
                current.Value.Factor *= arg;
                current = current.Next;
            }
            return(result);
        }
Esempio n. 4
0
        public static Polynome operator *(Polynome p, Monome m)
        {
            var result  = new Polynome(p);
            var current = result.polynomeList.First;

            while (current.Next != null)
            {
                current = current.Next;
            }
            current.Value.Factor *= m.Factor;
            current.Value.Degree += m.Degree;
            return(result);
        }
Esempio n. 5
0
        public static Polynome operator +(Polynome p, Monome m)
        {
            var result  = new Polynome(p);
            var current = result.polynomeList.First;

            while (current.Next != null && current.Value.Degree != m.Degree)
            {
                current = current.Next;
            }
            if (current.Value.Degree == m.Degree)
            {
                current.Value.Factor += m.Factor;
            }
            else
            {
                result.polynomeList.AddLast(m);
            }
            return(result);
        }
Esempio n. 6
0
        public static Polynome operator -(Monome m1, Monome m2)
        {
            var result = new Polynome(m1);

            return(result - m2);
        }