Пример #1
0
		public static Polynomial From(params double[] coefficients)
		{
			var v = new Polynomial();
			for (int i = 0; i < coefficients.Length; i++)
				v[i] = coefficients[i];
			return v;
		}
Пример #2
0
		public static Polynomial operator *(Polynomial p, Polynomial q)
		{
			var v = new Polynomial();
			foreach (var x in p)
				foreach (var y in q)
					v[x.Exponent + y.Exponent] += x.Coefficient * y.Coefficient;
			return v;
		}
Пример #3
0
		public static Polynomial Sum(params Polynomial[] args)
		{
			var v = new Polynomial();
			foreach (var arg in args)
				foreach (var term in arg)
					v[term.Exponent] += term.Coefficient;
			return v;
		}