예제 #1
0
        public Polynomial(PolyPart polyPart, Rational?coeff = null, Rational?power = null)
        {
            Type  = 1;
            Power = 1;
            if (power != null)
            {
                polyPart ^= (Rational)power;
            }
            if (coeff != null)
            {
                polyPart *= coeff;
            }

            Part = polyPart;
        }
예제 #2
0
 public Polynomial(Polynomial p)
 {
     Type  = p.Type;
     Power = p.Power;
     if (p.Type == 1)
     {
         Part = new PolyPart(p.Part.Coeff, new List <Variable>(p.Part.Variables));
     }
     else
     {
         foreach (Polynomial pol in p.Polynomials)
         {
             Polynomials.Add(pol.Copy());
         }
     }
     Coeff = p.Coeff;
 }