public static Polynome operator -(Polynome p, double arg) { var result = new Polynome(p); result.polynomeList.AddLast(-arg); return(result); }
public static Polynome operator *(Polynome p1, Polynome p2) { var result = new Polynome(p1); foreach (var monome in p2) { result *= monome; } return(result); }
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); }
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); }
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); }
public static Polynome operator -(Monome m1, Monome m2) { var result = new Polynome(m1); return(result - m2); }